-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: Java.lang.NoClassDefFoundError: org/dom4j/Attribute at ...
PostPosted: Fri Aug 06, 2004 5:06 pm 
Newbie

Joined: Fri Aug 06, 2004 4:48 pm
Posts: 8
Hello there,

It would be greatly appreciated if someone could help solve this issue: I'm trying to compile and run a very simple program using hibernate, ant without any containers. I've all the hibernate jar files (including dom4j-1.4.jar) in the "lib" directory and in my classpath. However, when issue command "ant run", I got the following errors: Java.lang.NoClassDefFoundError: org/dom4j/Attribute. at productInesrt.main(Unknown Source).
I definitely have the dom4j-1.4.jar file in the "lib" folder, AND "lib" is clearly in my classpath by viewing through set classpath command

Could somebody have knowledge what this message complains about? what to do to get rid of this message?

I'm using hibernate 2.1.3. DB2, ant 1.6.2.

Thanks in advance!

Tom[/b]


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 06, 2004 5:54 pm 
Newbie

Joined: Tue Jun 29, 2004 10:14 am
Posts: 11
Do you have just the lib directory in the classpath? That won't work. You must explicitly enumerate all the jar (or zip) files in a directory. A directory in the classpath will only load class files.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 06, 2004 6:00 pm 
Newbie

Joined: Fri Aug 06, 2004 4:48 pm
Posts: 8
I do have dom4j-1.4.jar file explicitly in my classpath, though not all other .jar files was doing the same way. Is this message complaining absense of dom4j-1.4.jar?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 06, 2004 6:06 pm 
Newbie

Joined: Tue Jun 29, 2004 10:14 am
Posts: 11
Try using:

Code:
java -classpath <classes dir>;<list of jars> Main.class


Use a ';' to separate jars on Windows, ":" on Unix/Linux.
[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 06, 2004 6:35 pm 
Newbie

Joined: Fri Aug 06, 2004 4:48 pm
Posts: 8
Thanks so much for replys. However, I'm using ant and "ant run" to compile and run, respectively. How does the command "java" with explicit classpath help on this? I'm not using any containers.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 06, 2004 6:41 pm 
Newbie

Joined: Tue Jun 29, 2004 10:14 am
Posts: 11
OK. One way or another, there is a path problem. The VM is not finding the jar files. Ant will try to construct the classpath for you. You need to check the initial paths in the ant file. Make sure that they will resolve to the right place.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 06, 2004 7:16 pm 
Newbie

Joined: Fri Aug 06, 2004 4:48 pm
Posts: 8
What Ant file do you refer in Windows platform? Do you refer to the .classpath file? does it work for Windows? It doesn't seem to re recognized in my program.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.