Skip to main content

Unable to start tomcat (JDBC-ORACLE CONNECTIVITY ISSUE WITYH OCI8 DRIVER using oracle 11g client.)

4 replies [Last post]
compc99
Offline
Joined: 2013-04-06
Points: 0

JDBC-ORACLE CONNECTIVITY ISSUE WITYH OCI8 DRIVER using oracle 11g client..
I am getting below error when i m trying to access oracle db using oracle 11g client. It works with earlier oracle client versions. how do i resolve this. is there any issue with version of ojdbc6.jar that i am using??? I cant use thin driver since its an old application for which i dont have source files.

Apr 6, 2013 1:00:59 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.UnsatisfiedLinkError: no ocijdbc9 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:992)
at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:262)
at oracle.jdbc.driver.OracleConnection.(OracleConnection.java:346)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:468)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at PettyCash.SysDate.getSysSubSys(SysDate.java:232)
at org.apache.jsp.PettyCash.index_jsp._jspService(org.apache.jsp.PettyCash.index_jsp:186)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

Code is as follow for reference

import oracle.jdbc.driver.*;

DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
conn = DriverManager.getConnection ("jdbc:oracle:oci8:@" + database,db_user, db_pass);

eNVIRONMENT VARIABLES set are as follows:
classpath
C:\Program Files\apache-tomcat-5.5.12\common\lib\servlet-api.jar;C:\Program Files\apache-tomcat-5.5.12\webapps\ROOT\WEB-INF\lib\classes12.jar;C:\Program Files\apache-tomcat-5.5.12\webapps\ROOT\WEB-INF\lib\ojdbc6.jar;

JAVA_HOME
C:\Program Files\Java\jdk1.5.0_04

PATH
C:\Program Files\Java\jdk1.5.0_04\bin

ORACLE_HOME
D:\Oracle11\product\11.2.0\client_1\BIN

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
dgodbey
Offline
Joined: 2006-10-27
Points: 0

Get rid of the classes12.jar file. You have two versions of the Oracle client, and that may be your problem.

compc99
Offline
Joined: 2013-04-06
Points: 0

dgodbey wrote:
Get rid of the classes12.jar file. You have two versions of the Oracle client, and that may be your problem.

thanks 4 ur reply.... previously there were 2 client installed but now there is only 1 (oracle 11g client).... will try removing classes12.jar from classpath .....i hope it works..

compc99
Offline
Joined: 2013-04-06
Points: 0

now a different error
Apr 8, 2013 10:58:10 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1650)

ENVIROMENT VARIABLES SET
USER VARIABLES
CLASSPATH
classpath%;C:\Program Files\apache-tomcat-5.5.12\common\lib\servlet-api.jar;D:\Oracle11\product\11.2.0\client_1\jdbc\lib\ojdbc6.jar;

PATH
C:\Program Files\Java\jdk1.5.0_04\bin

SYSTEM VARIABLES
JAVA_HOME
C:\Program Files\Java\jdk1.5.0_04
PATH
D:\Oracle11\product\11.2.0\client_1\BIN
ORACLE HOME
D:\Oracle11\product\11.2.0\client_1\BIN

what am i doing wrong???..

dgodbey
Offline
Joined: 2006-10-27
Points: 0

Looks like you are running tomcat using java 1.5, but there are jar files that were compiled with a more recent version of java. Unless you know what jar file that might be, you can try updating java to 1.6 and running tomcat with 1.6.

Btw, tomcat 5 is ancient. You really should upgrade your tomcat as well.