Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.lang.NoClassDefFoundError: oracle/sql/ORADataFactory

 
Mvelo Walaza
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have a problem when using ANT script to deploy to an environment.
When I use Windows 7 I get the following exception in Java Console when I try to login to my application:
Caused by: java.lang.NoClassDefFoundError: oracle/sql/ORADataFactory
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at sun.misc.Launcher$ExtClassLoader.findClass(Unknown Source)
...



But supisingly when I deploy the same code from a PC that uses Windows XP, everything works fine. The company wants to take away the old PC (XP) because they gave us the new ones (with Windows 7) so I have to get this to work on the new PC.

I am using JDK 1.6 on both PCs.

What could be the problem with the new PC? Please assist.

Regards,
Mvelo
 
Mvelo Walaza
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Still experiencing the same problem... Any suggestion/ideas out there?? Anyone?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which JDBC driver are you using, and where is it located ? Are you setting its location into your classpath in the Ant script ?
 
Mvelo Walaza
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Christophe,

Thanks for your reply.

I am using the latest Oracle JDBC driver (ojdbc14.jar) and it is located in my application's lib directory. Yes, I did specify it (ant the directory) in my Ant script.

For example:

My app resides in C:\DEVELOPMENT\myApp
Within this directory, there is a lib directory, whose path is specified in the Ant script (see below entry to my ant script).

<property name="c1" location="${lib}/ojdbc14.jar"/>

Regards,
Mvelo
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is this "c1" property ? Where is it used ? It doesn't prove that it is used in your classpath. Can you show your javac task ?
 
Mvelo Walaza
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here is my entire ant script:


 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That "classpath" property looks pretty ugly Instead of listing every single jars like this, can't you use a fileset with wildcards ? ([url=http://ant.apache.org/manual/using.html#path]Link[/
url])

Do you have the same directory structure in both machines ? I mean, is "src.root.dir" pointing at the right
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic