Can't connect to JDBC database

旧街凉风 提交于 2019-12-24 19:24:29

问题


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.

来源:https://stackoverflow.com/questions/47818029/cant-connect-to-jdbc-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!