I am getting Exception with Open JPA .
I have created WAS Data Source. Here is My Persistence XML
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd”>
<persistence-unit name="App11" transaction-type="JTA">
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
<jta-data-source>java:comp/env/jdbc/mydatasource</jta-data-source>
<class>vo.Entity</class>
<properties>
<property name="openjpa.TransactionMode" value="managed"/>
<property name="openjpa.ConnectionFactoryMode" value="managed"/>
</properties>
</persistence-unit>
I am getting this exception while executing.
aused by: org.apache.commons.lang.exception.NestableRuntimeException: There was an error duing JNDI lookup of the name “java:comp/env/jdbc/mydatasource”.
at org.apache.openjpa.lib.conf.Configurations.lookup(Configurations.java:592)
at org.apache.openjpa.conf.OpenJPAConfigurationImpl.lookupConnectionFactory(OpenJPAConfigurationImpl.java:966)
at org.apache.openjpa.conf.OpenJPAConfigurationImpl.getConnectionFactory(OpenJPAConfigurationImpl.java:954)
at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.createConnectionFactory(JDBCConfigurationImpl.java:801)
at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:568)
at org.apache.openjpa.jdbc.meta.MappingRepository.endConfiguration(MappingRepository.java:1221)
at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:476)
at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:401)
at org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:102)
at org.apache.openjpa.lib.conf.ObjectValue.instantiate(ObjectValue.java:82)
at org.apache.openjpa.conf.OpenJPAConfigurationImpl.newMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:861)
at org.apache.openjpa.conf.OpenJPAConfigurationImpl.getMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:852)
at org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:640)
at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:171)
Any help Appreciated.
Thanks,
Sam
Try adding
resource-refin yourweb.xmlwith runtime descriptor file (ibm-web-bnd.xml) as suggested in Websphere Datasource with a given JNDI name?