2015-10-14 106 views
0

我想在JBOSS與postgres9.4教育局創建數據源使用非官方驅動程序pgjdbc-ng-0.5-complete.jar但面臨異常。Postgres的pgjdbc-NG-0.5-complete.jar驅動程序異常拋出java.lang.ClassNotFoundException:javax.xml.bind.annotation.adapters.HexBinaryAdapter

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上創建數據源

回答

0

看起來你錯過了你的類路徑中的javax.xml.bind.jar。 此文件包含類javax.xml.bind.annotation.adapters.HexBinaryAdapter

將它添加到你的classpath中,錯誤應該消失。

+0

我已經在上面添加了jar,但異常仍然存在。 –