File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes NoClassDefFoundError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "NoClassDefFoundError" Watch "NoClassDefFoundError" New topic
Author

NoClassDefFoundError

Sunder Ganapathy
Ranch Hand

Joined: Apr 01, 2003
Posts: 120
I get the above message while using logging in a Hibernate program.

The message is java.lang.NoClassDefFoundError: Could not initialize class
org.hibernate.validator.ClassValidator.

I have all the jar files, namely, ejb3-persistence, hibernate3, hibernate.cfg,
hibernate-annotations, hibernate-commons-annotations, hibernate-entitymanager and hibernate-validator in both classpath and Tomcat lib file.
What could be the reason.
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

Classloaders are a mysterious thing.

Which class is using the class that can't be found. Package the jar along with that class, not just on the JVM or Tomcats classpath. Various components have different classloaders and this can trigger just these types of problems.

-Cameron McKenzie
Sunder Ganapathy
Ranch Hand

Joined: Apr 01, 2003
Posts: 120
Thanks Cameron.

When I came to know that validating can also be done using Hibernate,
I started using the same "C:\_hiblib" for this also. I was using Log4j also
in my program . In one of the JBOSS forums, I read that duplicate declarations
cause problems . Now the issue is resolved.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NoClassDefFoundError
 
Similar Threads
EJB3 JPA implementation
Hibernate and EJB 3.0
Hibernate ?
where is the error
avoid inserting empty string