Hi Ilya,
Your error indicates that you have not upgraded the OJB.properties file.
It contains some new entries which are needed in 0.9.7.
Please recheck your files!
cheers,
Thomas
Ilya Devers wrote:
> Hi,
>
> I just updated from 0.9.5 to 0.9.7. I use the binary distribution. I
> use the singleVM approach.
> I use Tomcat 4.0.10 and postgreSQL.
> I use the standard 0.9.7 ojb.properties file
> I changed the version in the repository.xml to 0.9.6 (looked in the
> mailing list archive)
>
> Something goes wrong right when I request a persistence broker, that
> makes the configurableFactory burp on a null pointer
>
> Did someone notice similar behaviour. Does somebody know what is
> happening.
>
> BTW: OJB is the first persistence layer I have used, and I really like
> it very much. Compliments to everybody!
>
> Here is the code:
> public Iterator getUsers() {
> logger.setLevel(Level.DEBUG);
>
> PersistenceBroker broker = null;
> try {
>
> List users = null;
> logger.debug("no search required");
> broker =
> PersistenceBrokerFactory.defaultPersistenceBroker();
> logger.debug("broker acquired");
> Query query = new QueryByCriteria(User.class, null);
> logger.debug("query created");
> users = new ArrayList(broker.getCollectionByQuery(query));
> logger.debug("arraylist obtained");
>
> return users.iterator();
>
> } catch (PBFactoryException ex) {
> logger.fatal("Could not get a PersistenceBroker ", ex);
>
> } catch (PersistenceBrokerException ex) {
> // if something went wrong: rollback
> logger.error("Could not get Users", ex);
>
> } finally {
> // return broker to pool
> if (broker != null) {
> broker.close();
> }
> }
> // if we did not return yet, something went wrong with the
> persistence broker!
> // Since this method is called from the presentation layer, we
> cannot show an appropriate error!
> // so we just return an empty iterator.
> return new ArrayList().iterator();
> }
>
> Here is the log file: Please note that "no search required" is the last
> thing in the log...
>
> Starting service Tomcat-Standalone
> Apache Tomcat/4.0.4
> Starting service Tomcat-Apache
> Apache Tomcat/4.0.4
> 0 DEBUG [HttpProcessor[8080][4]] view.UserViewer - inside Init
> 11 DEBUG [HttpProcessor[8080][4]] view.UserViewer - session is set
> 932 DEBUG [HttpProcessor[8080][4]] view.UserViewer - no search
> required
> 7251 DEBUG [HttpProcessor[8080][4]] ta.PersistenceBrokerFactoryFactory
> - Instantiate PersistenceBrokerFactory
> 7621 DEBUG [HttpProcessor[8080][4]]
> ta.PersistenceBrokerFactoryDefaultImpl - PersistenceBroker pool will be
> setup with
> the following configuration
> # Trace object of class
> org.apache.commons.pool.impl.GenericKeyedObjectPool$Config:
> # maxIdle -1
> # maxActive 100
> # maxWait 2000
> # whenExhaustedAction 0
> # testOnBorrow false
> # testOnReturn false
> # testWhileIdle false
> # timeBetweenEvictionRunsMillis -1
> # numTestsPerEvictionRun 3
> # minEvictableIdleTimeMillis 1000000
>
> 8012 DEBUG [HttpProcessor[8080][4]] ta.PersistenceBrokerFactoryFactory
> - PersistencebrokerFactory class: org.apache.ojb
> .broker.ta.PersistenceBrokerFactoryDefaultImpl
> 8082 DEBUG [HttpProcessor[8080][4]]
> ta.PersistenceBrokerFactoryDefaultImpl - createPersistenceBroker(key)
> called
> 8112 DEBUG [HttpProcessor[8080][4]]
> ta.PersistenceBrokerFactoryDefaultImpl - Create new PB instance
> 8112 INFO [HttpProcessor[8080][4]]
> ta.PersistenceBrokerFactoryDefaultImpl - Already created persistence
> broker instanc
> es: 0
> 8242 INFO [HttpProcessor[8080][4]] ConfigurableFactory -
> ConfigurableFactory called to serve a null instance
> 8473 FATAL [HttpProcessor[8080][4]] view.UserViewer - Could not get a
> PersistenceBroker
> java.lang.reflect.InvocationTargetException:
> java.lang.NullPointerException
> ...... etc.
>
>
> --
> ****************************************************************************
> This message contains information that may be privileged or confidential and
> is the property of the Cap Gemini Ernst & Young Group. It is only intended
> for the person to whom it is addressed. If you are not the intended
> recipient, you are not authorized to read, print, retain, copy disseminate,
> distribute, or use this message or any part thereof. If you receive this
> message in error, please notify the sender immediately and delete all copies
> of this message.
> ****************************************************************************
>
> --
> To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>
>
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>