java.lang.NoClassDefFoundError:oracle 11g数据库连接osgi

时间:2015-10-19 08:30:06

标签: java eclipse oracle11g osgi cq5

我正在使用CQ5上的Oracle数据库 - OSGI捆绑管理。起初我已经在系统包(org.apache.felix.framework)导入了类javax.crypt.Cipher

...
javax.crypto,version=0.0.0.1_007_JavaSE
javax.crypto.interfaces,version=0.0.0.1_007_JavaSE
javax.crypto.spec,version=0.0.0.1_007_JavaSE 
...

从那时起,我按照example创建了一个Oracle osgi连接器包并导入了包含javax.crypt.Cipher的pakcage:

Imported Packages   javax.crypto,version=0.0.0.1_007_JavaSE from org.apache.felix.framework (0)
                    javax.crypto.interfaces,version=0.0.0.1_007_JavaSE from org.apache.felix.framework (0)
                    javax.crypto.spec,version=0.0.0.1_007_JavaSE from org.apache.felix.framework (0)

当我调用sql连接到我的数据库时,出现了错误:

Caused by: java.lang.NoClassDefFoundError: javax/crypto/Cipher
    at oracle.security.o5logon.O5LoginClientHelper.decryptAES(Unknown Source)
    at oracle.security.o5logon.O5LoginClientHelper.generateOAuthResponse(Unknown Source)
    at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:655)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:366)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:536)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:228)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)
    at java.sql.DriverManager.getConnection(DriverManager.java:579)
    at java.sql.DriverManager.getConnection(DriverManager.java:221)
    at org.apache.commons.dbcp.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:65)
    at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)
    at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:974)
    at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:96)
    at org.apache.jsp.apps.dbtest.components.dbconnectiontest.body_jsp._jspService(body_jsp.java:179)
    at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:502)
    ... 129 more

由于我的理解javax.crypto.Cipher已经编译但在运行时不存在,您是否有任何想法来解决此问题?

1 个答案:

答案 0 :(得分:0)

通常这个类来自Oracle JDK包含的jce.jar。 但是你的软件无法使用不同类型的JDK,比如OpenJDK。

在运行时使此依赖项可用,包括JCE standalone jar