简体   繁体   中英

websphere liberty profile jdbc/jpa configuration

All, Here is the configuration I have...

<dataSource jndiName="jdbc/sample" id="sampleDS"      jdbcDriverRef="sampleJDBCDriver" type="javax.sql.DataSource" supplementalJDBCTrace="true" containerAuthDataRef="myuserId">
    <properties databaseName="SAMPLE" serverName="localhost" portNumber="50000" user="dbuser" password="password"></properties>
</dataSource>   
<jdbcDriver id="sampleJDBCDriver" libraryRef="db2lib" javax.sql.DataSource="javax.sql.DataSource" javax.sql.ConnectionPoolDataSource="javax.sql.ConnectionPoolDataSource" javax.sql.XADataSource="javax.sql.XADataSource"></jdbcDriver>
<library id="db2lib">        
    <fileset dir="C:\IBM\SQLLIB\java" includes='db2jcc4.jar db2jcc_license_cu.jar'></fileset>
</library>
<authData user="myuser" password="password" id="myuserId"></authData>

I get the following error...

[ERROR   ] CWWKE0701E: FrameworkEvent ERROR Bundle:com.ibm.ws.jdbc(id=99) org.osgi.framework.ServiceException: Exception in com.ibm.ws.resource.internal.ResourceFactoryTrackerData$1.getService()
at  org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:222)
at [internal classes]
 Caused by: java.lang.RuntimeException: java.sql.SQLNonTransientException: java.lang.InstantiationException: javax.sql.DataSource
at  com.ibm.ws.resource.internal.ResourceFactoryTrackerData$1.getService(ResourceFac toryTrackerData.java:109)
... 1 more
 Caused by: java.sql.SQLNonTransientException: java.lang.InstantiationException: javax.sql.DataSource
at  com.ibm.ws.jdbc.internal.JDBCDriverService.create(JDBCDriverService.java:292)
... 1 more
 Caused by: java.lang.InstantiationException: javax.sql.DataSource
at java.lang.J9VMInternals.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1628)
at  com.ibm.ws.jdbc.internal.JDBCDriverService$1.run(JDBCDriverService.java:233)
... 1 more


Event:org.osgi.framework.FrameworkEvent[source=com.ibm.ws.jdbc_1.0.9.cl50620150610-1749 [99]] 
     [ERROR   ] CWWKE0701E: FrameworkEvent ERROR Bundle:com.ibm.ws.jdbc(id=99) org.osgi.framework.ServiceException: Exception in com.ibm.ws.resource.internal.ResourceFactoryTrackerData$1.getService()
    at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:222)
    at [internal classes]
    at org.apache.openjpa.persistence.PersistenceUnitInfoImpl.toOpenJPAProperties(PersistenceUnitInfoImpl.java:396)
    at org.apache.openjpa.persistence.PersistenceProductDerivation.load(PersistenceProductDerivation.java:317)
    at org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:160)
    at org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:62)
    at com.ibm.ws.jpa.management.JPAPUnitInfo.createEMFactory(JPAPUnitInfo.java:1070)
    at [internal classes]
    Caused by: java.lang.RuntimeException: java.sql.SQLNonTransientException: java.lang.InstantiationException: javax.sql.DataSource
    at com.ibm.ws.resource.internal.ResourceFactoryTrackerData$1.getService(ResourceFactoryTrackerData.java:109)
    ... 7 more
    Caused by: java.sql.SQLNonTransientException: java.lang.InstantiationException: javax.sql.DataSource
    at com.ibm.ws.jdbc.internal.JDBCDriverService.create(JDBCDriverService.java:292)
    ... 7 more
    Caused by: java.lang.InstantiationException: javax.sql.DataSource
    at java.lang.J9VMInternals.newInstanceImpl(Native Method)
    at java.lang.Class.newInstance(Class.java:1628)
    at  com.ibm.ws.jdbc.internal.JDBCDriverService$1.run(JDBCDriverService.java:233)
    ... 7 more
   Event:org.osgi.framework.FrameworkEvent[source=com.ibm.ws.jdbc_1.0.9.cl50620150610-1749 [99]] 

Anybody ran into a similar error?

I am using the following version of WLP (WebSphere Application Server 8.5.5.6/wlp-1.0.9.cl50620150610-1749) on IBM J9 VM, version pwa6470sr7fp1ifx-20140821_01 (SR7 FP1+IV63158) (en_US)

Thanks Nags

All, I realized the issue. I had another jpa tag ahead of these JDBC tags like..

The above line was throwing the error I pasted above. As soon as I remove this line the error went away.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM