使用第三方 jdbc jar 与 jboss_redirected 冲突。文档生成器工厂
Using a thirdparty jdbc jar conflicts with jboss_redirected. _DocumentBuilderfactory
我在 jboss/modules/company/jdbc/other 中使用第三方 jdbc jar (drill-jdbc-all-1.13.jar),module.xml 在这里:
<module xmlns="urn:jboss:module:1.3" name="vermilion.jdbc.others" slot="main">
<resources>
<resource-root path="drill-jdbc-all-1.13.0.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
<module name="sun.jdk"/>
<module name="org.apache.commons.collections"/>
</dependencies>
</module>
但是,当我使用连接字符串调用驱动程序时,它似乎给我带来了冲突,并出现以下错误:
WARN 2018-05-02 12:09:57,467 (com.vermilionsoftware.vrs.common.biz.db.DGSFactory:109) 无法获取数据库连接:java.lang.ClassCastException: __redirected.__DocumentBuilderFactory 无法转换为 javax.xml.parsers.DocumentBuilderFactory
at javax.xml.parsers.DocumentBuilderFactory.newInstance(Unknown Source)
at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:2516)
at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:2492)
at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:2405)
at org.apache.hadoop.conf.Configuration.set(Configuration.java:1143)
at org.apache.hadoop.conf.Configuration.set(Configuration.java:1115)
at oadd.org.apache.drill.exec.rpc.security.kerberos.KerberosFactory.createAndLoginUser(KerberosFactory.java:59)
at oadd.org.apache.drill.exec.rpc.user.UserClient.authenticate(UserClient.java:219)
at oadd.org.apache.drill.exec.rpc.user.UserClient.connect(UserClient.java:155)
at oadd.org.apache.drill.exec.client.DrillClient.connect(DrillClient.java:432)
at oadd.org.apache.drill.exec.client.DrillClient.connect(DrillClient.java:379)
at org.apache.drill.jdbc.impl.DrillConnectionImpl.<init>(DrillConnectionImpl.java:158)
at org.apache.drill.jdbc.impl.DrillJdbc41Factory.newDrillConnection(DrillJdbc41Factory.java:72)
at org.apache.drill.jdbc.impl.DrillFactory.newConnection(DrillFactory.java:69)
at oadd.org.apache.calcite.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:143)
at org.apache.drill.jdbc.Driver.connect(Driver.java:72)
Hadoop 中的 Configuration.java 调用 DocumentBuilderFactory.newInstance() 而不指定任何 jaxp 实现,因此它使用应用程序 class 加载器而不是 class 创建实例加载程序正在加载 Configutaion.java class.
有人可以帮助我解决这个错误吗?
谢谢
我认为问题不在于您的 JAXP 实现没有被使用,而是您包含了一个 JAXP API,这是不允许的。您应该确保 drill-jdbc-all-*.jar
不包括 javax.xml
类.
通常这样的 ClassCastException
表示重复的 API JAR。
我在 jboss/modules/company/jdbc/other 中使用第三方 jdbc jar (drill-jdbc-all-1.13.jar),module.xml 在这里:
<module xmlns="urn:jboss:module:1.3" name="vermilion.jdbc.others" slot="main">
<resources>
<resource-root path="drill-jdbc-all-1.13.0.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
<module name="sun.jdk"/>
<module name="org.apache.commons.collections"/>
</dependencies>
</module>
但是,当我使用连接字符串调用驱动程序时,它似乎给我带来了冲突,并出现以下错误:
WARN 2018-05-02 12:09:57,467 (com.vermilionsoftware.vrs.common.biz.db.DGSFactory:109) 无法获取数据库连接:java.lang.ClassCastException: __redirected.__DocumentBuilderFactory 无法转换为 javax.xml.parsers.DocumentBuilderFactory
at javax.xml.parsers.DocumentBuilderFactory.newInstance(Unknown Source)
at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:2516)
at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:2492)
at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:2405)
at org.apache.hadoop.conf.Configuration.set(Configuration.java:1143)
at org.apache.hadoop.conf.Configuration.set(Configuration.java:1115)
at oadd.org.apache.drill.exec.rpc.security.kerberos.KerberosFactory.createAndLoginUser(KerberosFactory.java:59)
at oadd.org.apache.drill.exec.rpc.user.UserClient.authenticate(UserClient.java:219)
at oadd.org.apache.drill.exec.rpc.user.UserClient.connect(UserClient.java:155)
at oadd.org.apache.drill.exec.client.DrillClient.connect(DrillClient.java:432)
at oadd.org.apache.drill.exec.client.DrillClient.connect(DrillClient.java:379)
at org.apache.drill.jdbc.impl.DrillConnectionImpl.<init>(DrillConnectionImpl.java:158)
at org.apache.drill.jdbc.impl.DrillJdbc41Factory.newDrillConnection(DrillJdbc41Factory.java:72)
at org.apache.drill.jdbc.impl.DrillFactory.newConnection(DrillFactory.java:69)
at oadd.org.apache.calcite.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:143)
at org.apache.drill.jdbc.Driver.connect(Driver.java:72)
Hadoop 中的 Configuration.java 调用 DocumentBuilderFactory.newInstance() 而不指定任何 jaxp 实现,因此它使用应用程序 class 加载器而不是 class 创建实例加载程序正在加载 Configutaion.java class.
有人可以帮助我解决这个错误吗?
谢谢
我认为问题不在于您的 JAXP 实现没有被使用,而是您包含了一个 JAXP API,这是不允许的。您应该确保 drill-jdbc-all-*.jar
不包括 javax.xml
类.
通常这样的 ClassCastException
表示重复的 API JAR。