[OJB-developers] Bug in PersistenceBrokerFactoryJ2EEImpl
Brought to you by:
thma
From: Matthew B. <ma...@so...> - 2002-04-30 22:35:23
|
Summary: use in J2EE environment is broken due to improperly overridden configure() call. public class PersistenceBrokerFactoryJ2EEImpl extends PersistenceBrokerFactoryDefaultImpl /* * @see Configurable#configure(Configuration) */ public void configure(Configuration config) throws ConfigurationException { } The PersistenceBrokerFactoryJ2EEImpl extends PersistenceBrokerFactoryDefaultImpl and overrides PersistenceBrokerFactoryDefaultImpl's configure call with a no-op. During startup PersistenceBrokerFactoryJ2EEImpl calls into the base class to call the following: public PersistenceBroker createNewBrokerInstance() { try { PersistenceBroker instance = null; Class implementationClass = configuration.getPersistenceBrokerClass(); Class[] types = {DescriptorRepository.class}; Object[] args = {repository}; instance = (PersistenceBroker) implementationClass.getConstructor(types).newInstance(args); return instance; } catch (Throwable t) { throw new PersistenceBrokerException(t); } } a null pointer happens when trying to call getConstructor on implementationClass which is set during the configure call (never called due to no-op override). Solution is easy, remove the configure call from PersistenceBrokerFactoryJ2EEImpl and let the base class handle it. Thomas, can you commit this? |