[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - TopLink on JBoss: Cannot create toplink session

henkie.maritz@iits do-not-reply at jboss.com
Thu Jul 31 22:23:06 EDT 2008


I'm stuck and please need help on this.
I've used JDeveloper 10.1.3.3 to develop an app using TopLink. It works fine with the embedded OC4J. I use JDK 1.5.0_16.
When deploying it on JBoss 4.2.2 I get the following error:

Cannot acquire data source [jdbc/MYDBDS]
javax.naming.InvalidNameException: Not a compound name: jdbc/MYDBDS
oracle.toplink.jndi.JNDIConnector.connect(JNDIConnector.java:100)

Here is the code that tries to establish the connection:
    loader = new XMLSessionConfigLoader("META-INF/sessions.xml");
    mgr = SessionManager.getManager();
    session = (DatabaseSession)mgr.getSession(
                   loader, 
                   "default", 
                   Thread.currentThread().getContextClassLoader());

Here is the session.xml file extract:

 jdbc/MYDBDS
 <platform-class>oracle.toplink.platform.database.MySQL4Platform</platform-class>


Here is the mysql-dq.xml (JBoss DS def) extract:

  <local-tx-datasource>
    <jndi-name>MYDBDS</jndi-name>

I have tried various combinations of changing the toplink session and JBoss data source:
java:comp/env/jdbc/MYDBDS
comp/env/jdbc/MYDBDS
env/jdbc/MYDBDS
jdbc/MYDBDS
MYDBDS

I have also tried the solution described in this discussion:
http://forums.oracle.com/forums/message.jspa?messageID=1056712
It works getting by the JNDI lookup issue, but then I hit another error (can't get the session to load descriptors from a specific xml).

Please help me.

Henkie


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4168059#4168059

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4168059



More information about the jboss-user mailing list