使用c3p0连接DB2数据,在装入驱动程序时发生了安全性异常

我试过jdk1.7是没问题的,1.8就不行 这个怎么破,难道得永远用jdk1.7吗?


八月 15, 2017 10:43:52 上午 com.mchange.v2.log.slf4j.Slf4jMLog$Slf4jMLogger$InfoLogger log

信息: Origination unknown: [10228][11541][3.62.56] 在装入驱动程序时发生了安全性异常。 ERRORCODE=4223, SQLSTATE=null

com.ibm.db2.jcc.am.SqlWarning: Origination unknown: [10228][11541][3.62.56] 在装入驱动程序时发生了安全性异常。 ERRORCODE=4223, SQLSTATE=null

at com.ibm.db2.jcc.am.fd.b(fd.java:207)

at com.ibm.db2.jcc.am.fd.b(fd.java:258)

at com.ibm.db2.jcc.am.ib.a(ib.java:893)

at com.ibm.db2.jcc.am.jb.a(jb.java:579)

at com.ibm.db2.jcc.am.jb.<init>(jb.java:560)

at com.ibm.db2.jcc.t4.b.<init>(b.java:316)

at com.ibm.db2.jcc.DB2SimpleDataSource.getConnection(DB2SimpleDataSource.java:214)

at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:460)

at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:175)

at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:220)

at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:206)

at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:203)

at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1138)

at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1125)

at com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44)

at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1870)

at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)

Caused by: java.security.PrivilegedActionException: java.lang.ClassNotFoundException: sun.io.ByteToCharConverter

at java.security.AccessController.doPrivileged(Native Method)

at com.ibm.db2.jcc.am.ib.s(ib.java:879)

at com.ibm.db2.jcc.am.ib.<clinit>(ib.java:513)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:264)

at com.ibm.db2.jcc.DB2BaseDataSource.class$(DB2BaseDataSource.java:265)

at com.ibm.db2.jcc.DB2BaseDataSource.<clinit>(DB2BaseDataSource.java:265)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:264)

at com.ibm.db2.jcc.DB2Driver.class$(DB2Driver.java:68)

at com.ibm.db2.jcc.DB2Driver.<clinit>(DB2Driver.java:71)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:264)

at com.mchange.v2.c3p0.DriverManagerDataSource.ensureDriverLoaded(DriverManagerDataSource.java:143)

at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:173)

... 8 more

Caused by: java.lang.ClassNotFoundException: sun.io.ByteToCharConverter

at java.net.URLClassLoader.findClass(URLClassLoader.java:381)

at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)

at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:430)

at com.jfinal.server.JFinalClassLoader.loadClass(JFinalClassLoader.java:53)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:264)

at com.ibm.db2.jcc.am.jg.run(jg.java:19)

... 23 more


评论区

JFinal

2017-08-15 11:14

jdk 也是在不断升级的,而升级的过程中,以 sun 打头的那些 java 类可能会被删掉,例如 java 8 中就没有 sun.io.ByteToCharConverter

找一下 db2 的针对 java 8 的驱动,或许就解决了,驱动也是不断升级的

热门反馈

扫码入社