Help coderanch get a
new server
by contributing to the fundraiser

steve markin

Greenhorn
+ Follow
since Apr 06, 2013
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by steve markin

Tina Smith wrote:I usually get that if I compile using a higher version of Java than I run with. (eg compile under Java 7 JDK, run under Java 6 JRE). Type "java -version" at a command prompt and see what you get. It's going to need to be at least 1.5.x to work with the Java 5 JDK.

The Oracle install does include a version of Java that is quite low (I think 1.4).



but i havent specified that in environment variables. also adding ojdbc5.jar still doesnt seem 2 work.can you please check whether below envt variables set are correct or not???
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
now getting 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???..

Tina Smith wrote:I wasn't suggesting changing your code, I was suggesting changing the path that the JVM looks at to load the actual JDBC libraries. You have two possible locations to load the libraries from: classes12.jar and ojdbc6.jar. Both of these contain most of the same classes, although implementation may differ between the classes, and you don't know which DriverManager (the one in classes12 or the one in ojdbc6) the JVM is actually using. I would remove one from your classpath and see if it makes a difference.



ok. will set class path to any 1 jar file and try..thanks.. just wanted 2 ask does oci driver work with oracle 11g client ??

Tina Smith wrote:Just out of curiosity, any particular reason you have two JDBC drivers in your classpath? classes12.jar and ojdbc6.jar. I might be concerned about Java loading the wrong version of one of the classes and complaining.




which driver should i use? .i cant change the code since i some source files are missing .below is the Code is as follow for reference.
import oracle.jdbc.driver.*;
DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
conn = DriverManager.getConnection ("jdbcracleci8:@" + database,db_user, db_pass);
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.<init>(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