I'm getting the below jdbc driver not found error
, though I've included t4sqlmx-3.3.jar
in <liberty_server>/lib folder
. What additional changes are required?
<library id="sqlmx-lib">
<fileset dir="lib" includes="t4sqlmx-3.3.jar"/>
</library>
Error :
Caused by: java.sql.SQLNonTransientException: DSRA4000E: A valid JDBC driver implementation class was not found for the jdbcDriver dataSource[default-0]/jdbcDriver[default-0] using the library sqlmx-lib. []
at com.ibm.ws.jdbc.internal.JDBCDriverService.classNotFound(JDBCDriverService.java:207)
at com.ibm.ws.jdbc.internal.JDBCDriverService.createAnyDataSource(JDBCDriverService.java:368)
at com.ibm.ws.jdbc.DataSourceService.init(DataSourceService.java:592)
at com.ibm.ws.jca.cm.AbstractConnectionFactoryService$2.run(AbstractConnectionFactoryService.java:460)
at com.ibm.ws.jca.cm.AbstractConnectionFactoryService$2.run(AbstractConnectionFactoryService.java:457)
at java.security.AccessController.doPrivileged(Native Method)
at com.ibm.ws.jca.cm.AbstractConnectionFactoryService.initPrivileged(AbstractConnectionFactoryService.java:457)
at com.ibm.ws.jca.cm.AbstractConnectionFactoryService.createResource(AbstractConnectionFactoryService.java:144)
at com.ibm.ws.resource.internal.ResourceFactoryTrackerData$1.getService(ResourceFactoryTrackerData.java:120)
... 107 more
After datasource fix, some sqlmx specific error:
[12/05/18 14:39:26:473 EDT] 000003f8 SystemErr R Caused by: java.sql.SQLException: Pool requests blocked for dataSource[default-0]/connectionManager, connection pool is being shut down.
[12/05/18 14:39:26:473 EDT] 000003f8 SystemErr R at com.ibm.ws.rsadapter.AdapterUtil.toSQLException(AdapterUtil.java:822)
[12/05/18 14:39:26:473 EDT] 000003f8 SystemErr R at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource.java:152)
[12/05/18 14:39:26:474 EDT] 000003f8 SystemErr R at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource.java:116)
[12/05/18 14:39:26:474 EDT] 000003f8 SystemErr R at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:92)
[12/05/18 14:39:26:474 EDT] 000003f8 SystemErr R at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
[12/05/18 14:39:26:474 EDT] 000003f8 SystemErr R ... 95 more
[12/05/18 14:39:26:474 EDT] 000003f8 SystemErr R Caused by: javax.resource.spi.ResourceAllocationException: Pool requests blocked for dataSource[default-0]/connectionManager, connection pool is being shut down.
[12/05/18 14:39:26:475 EDT] 000003f8 SystemErr R at com.ibm.ejs.j2c.PoolManager.reserve(PoolManager.java:1275)
[12/05/18 14:39:26:475 EDT] 000003f8 SystemErr R at com.ibm.ejs.j2c.ConnectionManager.allocateMCWrapper(ConnectionManager.java:573)
[12/05/18 14:39:26:475 EDT] 000003f8 SystemErr R at com.ibm.ejs.j2c.ConnectionManager.allocateConnection(ConnectionManager.java:309)
[12/05/18 14:39:26:475 EDT] 000003f8 SystemErr R at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource.java:143)
[12/05/18 14:39:26:475 EDT] 000003f8 SystemErr R ... 98 more
Based on the stack trace, it appears that you have configured a <dataSource>
element in your server.xml, but not included it in your question. Using the <library>
configuration you did provide, your configuration might look like this:
<dataSource jndiName="jdbc/myDB" type="javax.sql.XADataSource">
<jdbcDriver libraryRef="sqlmx-lib" javax.sql.XADataSource="com.tandem.t4jdbc.SQLMXDataSource"/>
<properties databaseName="SAMPLEDB" hostName="localhost" port="12345"/>
</dataSource>
For more information on how to configure a DataSource in Liberty, see:
Configuring relational database connectivity in Liberty
NOTE: Based on googling for the SQL/MX JDBC driver documentation, I found that their XADataSource implementation class name is com.tandem.t4jdbc.SQLMXDataSource
. If that class name is not correct for your JDBC driver jar, then use whatever class your jar has. Also, if your driver does not provide any implementation of javax.sql.XADataSource
, then change the configuration to be javax.sql.ConnectionPoolDataSource
instead.