Sorry Bart, I copied&pasted the wrong exception.
The exception that I am getting is :
org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl -
Naming Exception while looking up DataSource (mydatasource)
javax.naming.NameNotFoundException: Name mydatasource is not bound in this
Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:768)
at org.apache.naming.NamingContext.lookup(NamingContext.java:151)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:136)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
I also tried to set jndi-datasource-name="java:/comp/env/mydatasource".
And it worked !!
Thanks !
Julio
----- Original Message -----
From: "Bart Molenkamp" <[EMAIL PROTECTED]>
To: "OJB Users List" <[email protected]>
Sent: Monday, May 30, 2005 10:19 AM
Subject: RE: Use OJB and JNDI Data Source
Hi,
Try to use "java:/comp/env/jdbc/siemens-hpps".
Bart.
-----Oorspronkelijk bericht-----
Van: J�lio Cesar de Melhado e Lima [mailto:[EMAIL PROTECTED]
Verzonden: maandag 30 mei 2005 14:22
Aan: OJB Users List
Onderwerp: Use OJB and JNDI Data Source
Hi all,
I've been using OJB API for a while. Until now, I've used only
repository_database configurated to access a database directly.
But now I need to configure it to access a database using a JNDI
DataSource.
I'm using Tomcat 5.0.28, Postgres 7.4 and OJB 1.0.1.
So, I made available a JNDI Resource "mydatasource", and this resource is
accessable ( I wrote a tiny jsp page to lookup for this object and
everything looks fine ).
Then a change the file "repository_database.xml" ( where I keep my
database
configuration ) to :
<jdbc-connection-descriptor
jcd-alias="default"
default-connection="true"
platform="PostgreSQL"
jdbc-level="3.0"
jndi-datasource-name="mydatasource"
batch-mode="false"
useAutoCommit="2"
ignoreAutoCommitExceptions="false">
But when I try to configure OJB to connect to this datasource, I only get
an
exception :
org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl -
Naming Exception while looking up DataSource (jdbc/siemens-hpps)
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:768)
at org.apache.naming.NamingContext.lookup(NamingContext.java:151)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:136)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
...
Can anyone help with this problem ?
Thanks a lot !
Julio
---------------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]