Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Ant, Maven and Other Build Tools and the fly likes java.lang.NoClassDefFoundError: oracle/sql/ORADataFactory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "java.lang.NoClassDefFoundError: oracle/sql/ORADataFactory" Watch "java.lang.NoClassDefFoundError: oracle/sql/ORADataFactory" New topic
Author

java.lang.NoClassDefFoundError: oracle/sql/ORADataFactory

Mvelo Walaza
Greenhorn

Joined: Sep 22, 2009
Posts: 7
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

Joined: Sep 22, 2009
Posts: 7
Still experiencing the same problem... Any suggestion/ideas out there?? Anyone?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Which JDBC driver are you using, and where is it located ? Are you setting its location into your classpath in the Ant script ?


[My Blog]
All roads lead to JavaRanch
Mvelo Walaza
Greenhorn

Joined: Sep 22, 2009
Posts: 7
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

Joined: Nov 24, 2005
Posts: 14687
    
  16

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

Joined: Sep 22, 2009
Posts: 7
here is my entire ant script:


Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.lang.NoClassDefFoundError: oracle/sql/ORADataFactory
 
Similar Threads
test cases for a servlet
Tricky class loading error
JBoss Server V4.2 NOT getting Started
Why I can't run Web Start when my class using hibernate?
Reading data from Serial Port device using javax.comm API