Add jcd-alias attribute to jdbc-connection, set it equal to "default". Then if your repositlry.xml is in WEB-INF/classes, you should be able to use:
db.open("default", Database.OPEN_READ_WRITE);
-chris wroley
I am using OJB version 0.9.9. When executing the following line:
db.open("/WEB-INF/classes/repository.xml", Database.OPEN_READ_WRITE);
I receive the following error when attempting to open a database
java.lang.NullPointerException java.lang.NullPointerException at org.apache.ojb.broker.util.BrokerHelper.extractAllTokens(Unknown Source) at org.apache.ojb.odmg.DatabaseImpl.open(Unknown Source)
I am using Tomcat, DBCP and of course OJB. I have declared a DBCP datasource in JNDI as "jdbc/myDB". I am able to successfully connect to this datasource in a jsp. I have placed the following files in my "/WEB-INF/classes" directory:
repository.dtd repository.xml repository_database.xml repository_internal.xml repository_junit.xml repository_user.xml repository_ejb.xml OJB.properties
In my repository_database.xml file, I have defined the following: <jdbc-connection-descriptor platform="MsSQLServer" default-connection="true" jdbc-level="2.0" jndi-datasource-name="java:/comp/env/jdbc/myDB" />
In my OJB.properties file, I have tried each of the following without any luck: ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryPo oledImpl ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryNo tPooledImpl ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryMa nagedImpl ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryDB CPImpl
Because my jndi database connection is a datasource, I thought I should have all commented out except ConnectionFactoryManagedImpl.
Any ideas?
Regards,
Joshua
This communication, including attachments, is for the exclusive use of addressee and may contain proprietary, confidential or privileged information. If you are not the intended recipient, any use, copying, disclosure, dissemination or distribution is strictly prohibited. If you are not the intended recipient, please notify the sender immediately by return email and delete this communication and destroy all copies.
--------------------------------------------------------------------- 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]