Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Dhanaji Patil
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
Dhanaji Patil
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are welcome
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic