-->

Can't connect to JDBC database

2019-08-28 11:04发布

问题:

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.