postgres pgjdbc-ng-0.5-complete.jar驱动程序异常java.lang.ClassNotFoundException:javax.xml.bind.annotation.adapters.HexBinaryAdapter

时间:2015-10-14 13:16:29

标签: postgresql-9.3

我正在尝试使用postgres9.4 EDB在JBOSS上创建数据源,使用非官方驱动程序pgjdbc-ng-0.5-complete.jar但面临异常。

Caused by: java.sql.SQLException: Connection Error: java.lang.ClassNotFoundException: javax.xml.bind.annotation.adapters.HexBinaryAdapter from [Module "com.pgng.jdbc:main" from local module loader @83914b (finder: local module finder @1b80053 (roots: D:\jboss-eap-6.1\modules,D:\jboss-eap-6.1\modules\system\layers\base))]
    at com.impossibl.postgres.jdbc.ConnectionUtil.createConnection(ConnectionUtil.java:189)
    at com.impossibl.postgres.jdbc.PGDriver.connect(PGDriver.java:77)
    at com.impossibl.postgres.jdbc.PGDriver.connect(PGDriver.java:52)
    at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:254) [ironjacamar-jdbc-1.0.17.Final-redhat-1.jar:1.0.17.Final-redhat-1]
    ... 34 more
Caused by: java.io.IOException: java.lang.ClassNotFoundException: javax.xml.bind.annotation.adapters.HexBinaryAdapter from [Module "com.pgng.jdbc:main" from local module loader @83914b (finder: local module finder @1b80053 (roots: D:\jboss-eap-6.1\modules,D:\jboss-eap-6.1\modules\system\layers\base))]
    at com.impossibl.postgres.protocol.v30.ProtocolImpl.execute(ProtocolImpl.java:381)
    at com.impossibl.postgres.protocol.v30.ProtocolFactoryImpl.startup(ProtocolFactoryImpl.java:215)
    at com.impossibl.postgres.protocol.v30.ProtocolFactoryImpl.connect(ProtocolFactoryImpl.java:155)
    at com.impossibl.postgres.protocol.v30.ProtocolFactoryImpl.connect(ProtocolFactoryImpl.java:90)
    at com.impossibl.postgres.system.BasicContext.<init>(BasicContext.java:130)
    at com.impossibl.postgres.jdbc.PGConnectionImpl.<init>(PGConnectionImpl.java:185)
    at com.impossibl.postgres.jdbc.ConnectionUtil.createConnection(ConnectionUtil.java:180)
    ... 37 more
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.adapters.HexBinaryAdapter from [Module "com.pgng.jdbc:main" from local module loader @83914b (finder: local module finder @1b80053 (roots: D:\jboss-eap-6.1\modules,D:\jboss-eap-6.1\modules\system\layers\base))]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:196) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:432) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:374) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:119) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at com.impossibl.postgres.utils.MD5Authentication.encode(MD5Authentication.java:51)
    at com.impossibl.postgres.protocol.v30.StartupCommandImpl$1.authenticateMD5(StartupCommandImpl.java:126)
    at com.impossibl.postgres.protocol.v30.ProtocolImpl.receiveAuthentication(ProtocolImpl.java:891)
    at com.impossibl.postgres.protocol.v30.ProtocolImpl.dispatch(ProtocolImpl.java:774)
    at com.impossibl.postgres.protocol.v30.MessageHandler.channelRead(MessageHandler.java:46)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:242)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:847)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)
    at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]

请帮帮我。 需要使用pgjdbc-ng-0.5-complete.jar驱动程序在JBOSS EAP7上创建数据源

1 个答案:

答案 0 :(得分:0)

您似乎错过了类路径中的javax.xml.bind.jar。 此文件包含类javax.xml.bind.annotation.adapters.HexBinaryAdapter

将它添加到类路径中,错误应该消失。