-->
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.  [ 4 posts ] 
Author Message
 Post subject: java.lang.NoClassDefFoundError: org/hibernate/validator/even
PostPosted: Mon Jul 21, 2008 6:26 pm 
Newbie

Joined: Mon Jul 21, 2008 6:23 pm
Posts: 3
I am newbie and trying to integrate glassfish with hibernate.

I am getting the following error msg when server starts

java.lang.NoClassDefFoundError: org/hibernate/validator/event/ValidateEventListener

Complete Stack Trace :
Hibernate Annotations 3.3.1.GA
93 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.3.0.CR1
93 [main] INFO org.hibernate.cfg.Environment - hibernate.properties not found
109 [main] INFO org.hibernate.cfg.Environment - Bytecode provider name : cglib
109 [main] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
CORE5016: Unexpected error occurred while loading applications
java.lang.NoClassDefFoundError: org/hibernate/validator/event/ValidateEventListener
at org.hibernate.ejb.EventListenerConfigurator.<init>(EventListenerConfigurator.java:69)
at org.hibernate.ejb.Ejb3Configuration.<init>(Ejb3Configuration.java:78)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:114)
at com.sun.enterprise.server.PersistenceUnitLoaderImpl.load(PersistenceUnitLoaderImpl.java:149)
at com.sun.enterprise.server.PersistenceUnitLoaderImpl.load(PersistenceUnitLoaderImpl.java:84)
at com.sun.enterprise.server.AbstractLoader.loadPersistenceUnits(AbstractLoader.java:898)
at com.sun.enterprise.server.ApplicationLoader.doLoad(ApplicationLoader.java:184)
at com.sun.enterprise.server.TomcatApplicationLoader.doLoad(TomcatApplicationLoader.java:126)
at com.sun.enterprise.server.AbstractLoader.load(AbstractLoader.java:244)
at com.sun.enterprise.server.AbstractManager.load(AbstractManager.java:225)
at com.sun.enterprise.server.ApplicationLifecycle.onStartup(ApplicationLifecycle.java:217)
at com.sun.enterprise.server.ApplicationServer.onStartup(ApplicationServer.java:442)
at com.sun.enterprise.server.ondemand.OnDemandServer.onStartup(OnDemandServer.java:120)
at com.sun.enterprise.server.PEMain.run(PEMain.java:411)
at com.sun.enterprise.server.PEMain.main(PEMain.java:338)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.enterprise.server.PELaunch.main(PELaunch.java:412)


Please help.

Regards,
Tom


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 21, 2008 10:29 pm 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
I'm sad to say, it's as simple as that jar not being available to your applications when they are deployed.

Identify which application is throwing that exception, and then find out where the jar file containing that class comes from. Make sure it's either packaged with the app, or placed on the classpath of the server, although depending on how classloaders are configured, that might not be the silver bullet.

In all likelihood, the developers linked to the jar file externally during development, so it wasn't part of the deployed application, and now you're having a ClassNotFoundException on the server.

Hope that helps!

-Cameron McKenzie

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
 Post subject: What jar to include?
PostPosted: Tue Jul 22, 2008 11:22 am 
Newbie

Joined: Mon Jul 21, 2008 6:23 pm
Posts: 3
Thanks for the reply Cameron, but can you let me know the jar name that I need to include..I have googled this error and sometimes some one says you need to remove hibernate3.jar, sometimes remove the annotations jar. Nothing has worked so far.

Currently, I have I have hibernate3.jar, hibernate-annotations.jar and hibernate-common-annotations.jar in lib directory of glassfish.

Yes, its correct. Glassfish looks at those hibernate files at run time in its lib directory and that's where it throws this error on server startup.

Regards,
Tom.


Top
 Profile  
 
 Post subject: Issue Resolved
PostPosted: Tue Jul 22, 2008 11:38 am 
Newbie

Joined: Mon Jul 21, 2008 6:23 pm
Posts: 3
Never mind.

I added hibernate-validator.jar to lib and its working fine (although I am getting other exceptions like java.lang.reflect.InvocationTargetException
but the validator exception is gone.

Thanks for the reply and bearing with a newbie in Hibernate.

Regards,
Tom


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.