So it appears that the repository.xml file is being read.
But this is quite puzzling, because my OJB.properties and repository.xml files are indeed working when I run my code inside Eclipse.
Still puzzled. Anyone have any ideas I could try?
phil.
Armin Waibel wrote:
Hi,
I think it could be more simple.
You lookup the PB instance via the convenience method PBF#.defaultPersistenceBroker().
To use this method you have to specify one connection-descriptor as default one.
http://db.apache.org/ojb/docu/faq.html#lookupPB
regards, Armin
Thomas Dudziak wrote:
WHIRLYCOTT wrote:
Greetings,
I'm working away quite happily here with some code using OJB from inside Eclipse. However, now that I've started integrating this code into a webapp using Struts, I'm getting an exception that indicates that OJB is having some trouble reading the OJB.properties file.
It's located in $TOMCAT/webapps/appname/WEB-INF/classes/OJB.properties, which I believe is correct. I also have my repository.xml file in the same directory.
Ideas?
phil.
2004-06-23 15:51:40 StandardWrapperValve[action]: Servlet.service() for servlet action threw exception
org.apache.ojb.broker.PBFactoryException: There was no default-PBKey specified
at org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.defaultPersistenceBroker(Unknown Source)
at org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown Source)
at com.something.lst.AbstractBaseFacade.<init>(Unknown Source)
at com.something.lst.LetterDefinitionFacade.<init>(Unknown Source)
at com.something.appname.actions.LetterLibraryAction.execute(Unknown Source)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
OJB.properties seem to have been read, but there is a problem with the connection descriptor. The message says that there is no jdbc-connection-descriptor that is configured to be the default connection. This can either mean that you have an error in your connection descriptor(s), or that OJB did not find the repository metadata.
You can increase the logging level of OJB to INFO or DEBUG (in OJB.properties) to get some more info on what OJB does.
Also please post you repository_database.xml file which contains the jdbc-connection-descriptor.
Tom
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- Whirlycott Philip Jacob [EMAIL PROTECTED] http://www.whirlycott.com/phil/
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
