This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes JDBC and the fly likes OracleTypes error while Migrating app in Java 6 with Weblogic 10.3.4 server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "OracleTypes error while Migrating app in Java 6 with Weblogic 10.3.4 server" Watch "OracleTypes error while Migrating app in Java 6 with Weblogic 10.3.4 server" New topic
Author

OracleTypes error while Migrating app in Java 6 with Weblogic 10.3.4 server

Dhanaji Patil
Greenhorn

Joined: Mar 31, 2011
Posts: 8
Hi,
We have an application that is running fine in production with java version 1.5 and weblogic server 9.2.0. Now we are migrating the same application to Java version 6 and weblogic server 10.3.4. We have integrated our application using eclipse IDE and its working fine. But when I am trying to build the ear using ant script, I am getting below error -

[javac] C:/Build XML_10.3.4/src/com/dao/ApplyDAO.java:21: cannot access oracle.jdbc.OracleTypes
[javac] bad class file: C:\Build XML_10.3.4\ojdbc6.jar(oracle/jdbc/OracleTypes.class)
[javac] class file has wrong version 50.0, should be 49.0
[javac] Please remove or make sure it appears in the correct subdirectory of the classpath.
[javac] import oracle.jdbc.OracleTypes;
[javac] ^
[javac] 1 error

I have tried running the build by setting the ojdbc6.jar(copied from the weblogic 10.3.4 server\lib installation folder) or classes111.jar in classpath. Could anyone please assist me in finding out whats went wrong? Will appreciate the help...
Fatih Keles
Ranch Hand

Joined: Sep 01, 2005
Posts: 182
Hi Dhanaji,

I am not an expert about ant scripting but it seems to me that your ant script is using and expecting java 1.5 but your driver jar is for 1.6. You should define the correct javac used by your ant script.
Dhanaji Patil
Greenhorn

Joined: Mar 31, 2011
Posts: 8
Thanks for your help Fatih.
I had forgotten to change the version. Now I changed it to java 1.6 and now its giving me different error:

[javac] C:\Build XML_10.3.4\src\com\dao\ApplyDAO.java:27:oracle.jdbc.driver.OracleTypes is not public in oracle.jdbc.driver; cannot be accessed from outside package
[javac] import oracle.jdbc.driver.OracleTypes;
[javac] ^

I have tried using classes111.jar and ojdbc6.jar. Thanks in advance.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


I have tried using classes111.jar and ojdbc6.jar.

Those are drastically different drivers, which do you intend to use? If you are running JDK6 regardless of the Oracle version, ojdbc6.jar is the version you need to be using.

The package oracle.jdbc.driver I think is deprecated - try oracle.jdbc.OracleTypes instead.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Dhanaji Patil
Greenhorn

Joined: Mar 31, 2011
Posts: 8
Hey Thanks a lot Paul..
I used ojdbc.jar and also chagned the package structure for OracleTypes, and now I am able to build the ear. Thanks.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

You are welcome
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: OracleTypes error while Migrating app in Java 6 with Weblogic 10.3.4 server
 
Similar Threads
Weblogic 10 Issue with Java 1.4
No suitable home found for Bean Class??
debugging with ANT
request.getAttribute returns blank
ant file not running