我正在尝试将Websphere Liberty v16.0.0.4连接到HANA数据源,但是找不到正确的驱动程序。
当前在我的 server.xml 中,我具有以下内容:
<xml version="1.0" encoding="UTF-8">
<server description="o01-cls-pega-static-prpc02-appsrv03">
<!-- Enable features -->
<featureManager>
<feature>webProfile-7.0</feature>
<feature>localConnector-1.0</feature>
<feature>jdbc-4.1</feature>
<feature>ssl-1.0</feature>
<feature>servlet-3.1</feature>
<feature>ejb-3.2</feature>
<feature>ejbLite-3.2</feature>
<feature>ejbRemote-3.2</feature>
<feature>jndi-1.0</feature>
<feature>jms-2.0</feature>
<feature>jaxws-2.2</feature>
<feature>jaxb-2.2</feature>
<feature>restConnector-2.0</feature>
<feature>wmqJmsClient-2.0</feature>
<feature>jmsMdb-3.2</feature>
</featureManager>
<httpEndpoint id="defaultHttpEndpoint"
host="localhost"
httpPort="28740"
httpsPort="28741" />
<!-- JDBC Hana Driver -->
<jdbcDriver id="myHanaDriver" javax.sql.DataSource="com.ibm.ws.jdbc.jdbcDriver">
<library>
<fileset dir="${wlp.user.dir}/shared/resources/hana" includes="*.jar" id="HANALib"/>
</library>
</jdbcDriver>
<!-- HANA JDBC Databases -->
<dataSource
type="javax.sql.DataSource"
containerAuthDataRef="PegaDBUserSAPHANA"
id="hanaDataSource"
jdbcDriverRef="myHanaDriver"
jndiName="jdbc/hanaDataSource">
<properties serverName="localhost" port="35315"/>
</dataSource>
<applicationManager autoExpand="true"/>
</server>
这是我得到的错误:
[5/6/19 14:24:24:735 CEST] 00000038 LogService-156-com.ibm.ws.jdbc
E CWWKE0701E: FrameworkEvent ERROR Bundle:com.ibm.ws.jdbc(id=156) org.osgi.framework.ServiceException:
Exception in com.ibm.ws.resource.internal.ResourceFactoryTrackerData$1.getService()
Caused by: java.lang.RuntimeException: java.sql.SQLNonTransientException:
DSRA4000E: A valid JDBC driver implementation class was not found for the jdbcDriver jdbcDriver[myHanaDriver] using the library com.ibm.ws.classloading.sharedlibrary_587. [/opt/wlp/usr/shared/resources/hana/ngdbc.jar]
Caused by: java.sql.SQLNonTransientException:
DSRA4000E: A valid JDBC driver implementation class was not found for the jdbcDriver jdbcDriver[myHanaDriver] using the library com.ibm.ws.classloading.sharedlibrary_587. [/opt/wlp/usr/shared/resources/hana/ngdbc.jar]
Caused by: java.lang.ClassNotFoundException: com.ibm.ws.jdbc.jdbcDriver
任何能帮助我获得我所需的正确实现类的人吗?
答案 0 :(得分:0)
您正确的配置了javax.sql.DataSource="com.ibm.ws.jdbc.jdbcDriver"
。这应该指向JDBC驱动程序的javax.sql.DataSource实现,例如javax.sql.DataSource="com.sap.dbtech.jdbcext.DataSourceSapDB"
或者,对于许多JDBC驱动程序,如果完全省略了此配置属性,则新版本的Liberty(但不是此问题要求的较早的16.0.0.4级别)通常能够推断出正确的实现类。
答案 1 :(得分:0)
我现在可以正常使用了,我对此进行了更改: javax.sql.DataSource =“ com.ibm.ws.jdbc.jdbcDriver” 进入 javax.sql.ConnectionPoolDataSource =“ com.sap.db.jdbcext.ConnectionPoolDataSourceSAP”
然后在此type =“ javax.sql.ConnectionPoolDataSource”中输入=“ javax.sql.DataSource”。