Hi
I managed to get the JNDI ref for the dbcp connectionpool.
My persistence.xml looks like this:
<persistence xmlns="
http://java.sun.com/xml/ns/persistence" version="1.0">
<persistence-unit name="kmaheshw">
<provider>oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider</provider>
[b]<non-jta-data-source>file:///home/kmaheshw/psemia/jdbc/cpds</non-jta-data-source>[/b]
<class>entity.UserSessionEventPK</class>
<properties>
<!-- Provider-specific settings -->
<property name="toplink.logging.level" value="WARNING"/>
</properties>
</persistence-unit>
</persistence>
Now i am getting this exception when i run my program that creates entitymanager:
Exception in thread "main" java.lang.ClassCastException: org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS
at oracle.toplink.essentials.jndi.JNDIConnector.connect(JNDIConnector.java:114)
at oracle.toplink.essentials.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:170)
at oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:537)
at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:206)
at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:212)
at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:78)
at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:111)
at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:105)
at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:76)
at entity.TestJpa.main(TestJpa.java:20)
Any clue what is going wrong?
[Message sent by forum member 'ketancmaheshwari' (ketancmaheshwari)]
http://forums.java.net/jive/thread.jspa?messageID=215757