title: Open JPA Exception with Datasource in WAS 7.0 Java
body: <p>I am getting Exception with Open JPA .</p>
  
  <p>I have created WAS Data Source. Here is My Persistence XML</p>
  
  <p>http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"></p>
  
  <pre><code>&lt;persistence-unit name="App11" transaction-type="JTA"&gt;
  &lt;provider&gt;org.apache.openjpa.persistence.PersistenceProviderImpl&lt;/provider&gt;
  &lt;jta-data-source&gt;java:comp/env/jdbc/mydatasource&lt;/jta-data-source&gt;  
       &lt;class&gt;vo.Entity&lt;/class&gt;
       &lt;properties&gt;
          &lt;property name="openjpa.TransactionMode" value="managed"/&gt;
                  &lt;property name="openjpa.ConnectionFactoryMode" value="managed"/&gt;
      &lt;/properties&gt;
      &lt;/persistence-unit&gt;
  </code></pre>
  
  <p></p>
  
  <p>I am getting this exception while executing.</p>
  
  <p>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)</p>
  
  <p>Any help Appreciated. </p>
  
  <p>Thanks,
  Sam</p>