• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

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.
 
Whip out those weird instruments of science and probe away! I think it's a tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic