0

I am trying to run a project in my WAS local server. The problem is I keep getting this error:

Unsupported use of GenericConnection. A GenericConnection is provided during application start when creating an EntityManagerFactory for a persistence unit which has configured one of its datasource to be in the component naming context; java:comp/env. During application start, the component naming context will not exist, and the correct datasource cannot be determined. When the persistence unit is used, the proper datasource and connection will be obtained and used.

In my persistence.xml file I have this:

<persistence-unit name="myPUnit"    transaction-type="RESOURCE_LOCAL" > 
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <non-jta-data-source>jdbc/myPUnit</non-jta-data-source>  
    <properties>    
        <property name="eclipselink.logging.level" value="INFO" />
        <property name="eclipselink.jdbc.driver" value="oracle.jdbc.OracleDriver" />
        <property name="eclipselink.cache.shared.default" value="false"/>       
    </properties>   
</persistence-unit>

I don't think there's anything wrong with my persistence.xml file, but I keep getting the above mentioned error.

I'm using java 1.8, RAD 9.5 and WAS 8.5.

user1766169
  • 1,932
  • 3
  • 22
  • 44
annie
  • 177
  • 2
  • 3
  • 15
  • 1
    Is this Liberty or Traditional WebSphere? It seems that you have not configured a data source for "jdbc/myPUnit". If this is Liberty, make sure you have properly added a dataSource to your server.xml (You can find instructions here: https://www.ibm.com/support/knowledgecenter/en/SSD28V_8.5.5/com.ibm.websphere.wlp.core.doc/ae/twlp_dep_configuring_ds.html). For Traditional WAS, try the following: https://www.ibm.com/support/knowledgecenter/en/SSAW57_8.5.5/com.ibm.websphere.nd.doc/ae/twim_fedmap_datasconf.html – Will Dazey Dec 14 '17 at 21:59
  • @WillDazey It's traditional WAS and I have configured the data source for `jdbc/myPUnit` , so I don't understand what else might be wrong. – annie Dec 15 '17 at 13:31

0 Answers0