db-ojb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Danilo Tommasina <dtommas...@risksys.com>
Subject Re: Location of repository.xml
Date Tue, 14 Jun 2005 07:09:06 GMT
Hi,

In OJB.properties you can specify the location of the repository.xml. The default is just
'repository.xml' so that the file will be searched at the root of your
 classpath entries.

In this case java will try to load the repository.xml from your web-application classpath,
then from the environment classpath, I guess that the directory '.'
is included in your classpath, this will be the directory where you started the JVM, in the
case of your tomcat this is D:/jakarta-tomcat-5.0.28/bin/

You have two possiblities you can do it the dirty way (if you are just testing stuff) by setting
the absolute path to the repository.xml in OJB.properties and
setting the path to OJB.properties in the System properties.
Or do it the 'good' way by just putting your OJB.properties and the repository.xml in the
WEB-INF/classes of your web application without setting any System
properties or modifiing the default path to the respoitory.xml

bye
Danilo

> Hi,
>  
> I'm using OJB 1.0.3 with Tomcat 5.0.28.
> In my servlet I set 
> System.setProperty("OJB.properties",
> "D:/jakarta-tomcat-5.0.28/webapps/MyWebAppConfig/OJB.properties");
> Doing this loads OJB.properties without problems.
> But "repository.xml" is not found though it is located in the same
> directory.
>  
> OJB is trying to load this file from "D:/jakarta-tomcat-5.0.28/bin".
> Strange....
>  
> Here' the error message.
>  
> - OJB Descriptor Repository:
> file:/D:/jakarta-tomcat-5.0.28/bin/repository.xml
> - Building repository from
> :file:/D:/jakarta-tomcat-5.0.28/bin/repository.xml
> - No repository.xml file found, starting with empty metadata and
> connection configuration
> - No 'default-connection' attribute set in jdbc-connection-descriptors,
> thus it's currently not possible to use 'defaultPersistenceBroker()'
> convenience method to lookup PersistenceBroker instances.
> But it's possible to enable this at runtime using 'setDefaultKey'
> method.
> - Could not find org.apache.ojb.broker.metadata.JdbcConnectionDescriptor
> for PBKey org.apache.ojb.broker.PBKey: jcdAlias=default, user=null,
> password=null
> - # finalize DescriptorRepository instance #
> org.apache.ojb.broker.PBFactoryException: Borrow broker from pool
> failed, using PBKey org.apache.ojb.broker.PBKey: jcdAlias=default,
> user=null, password=null
>         at
> org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.createPer
> sistenceBroker(Unknown Source)
>         at
> org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.createPersis
> tenceBroker(Unknown Source)
>         at
> org.apache.ojb.broker.PersistenceBrokerFactory.createPersistenceBroker(U
> nknown Source)
>  
>  
> Thank you,
> Frank
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Mime
View raw message