• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

NoClassDefFoundError

 
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic