环境 WebLogic8.1 , Oracle 9.0.1 , Windows Server 2003
Driver Classname: oracle.jdbc.OracleDriver
URL: jdbc:oracle:oci:@primav4
(primav4为oracle client配置的DB Alias)
java.lang.UnsatisfiedLinkError: no ocijdbc10 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1517)
at java.lang.Runtime.loadLibrary0(Runtime.java:788)
at java.lang.System.loadLibrary(System.java:834)
at oracle.jdbc.driver.T2CConnection.loadNativeLibrary(T2CConnection.java:2855)
at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:222)
at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:344)
at oracle.jdbc.driver.T2CConnection.(T2CConnection.java:136)
at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:79)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:545)
at weblogic.management.console.utils.JDBC.testConnection(JDBC.java:143)
at weblogic.management.console.actions.mbean.JDBCConnectionPoolTestAction.prePerform(JDBCConnectionPoolTestAction.java:106)
at weblogic.management.console.actions.mbean.DoMBeanWizardAction.perform(DoMBeanWizardAction.java:215)
at weblogic.management.console.actions.internal.ActionServlet.doAction(ActionServlet.java:173)
at weblogic.management.console.actions.internal.ActionServlet.doPost(ActionServlet.java:85)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6452)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
solution:
weblogic本身自带的oracle jdbc驱动程序和自己安装的数据版本可能不太一样,OCI 要求weblogic和oracle的版本一致。直接使用oracle提供的jdbc的jar覆盖weblogic的server/lib,server/ext/jdbc/oracle/*的jar(ojdbc14.jar,ojdbc14_g.jar)即可,而后重新启动weblogic再次配置即可。