Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Hibernate: java.lang.NoClassDefFoundError: org/apache/common
PostPosted: Sat Sep 20, 2003 4:25 am 
Beginner
Beginner

Joined: Sat Sep 20, 2003 4:23 am
Posts: 48
I'm playing around with hibernate but am getting the following error message:

Code:
java.lang.NoClassDefFoundError: org/apache/commons/lang/exception/NestableException
   at java.lang.ClassLoader.defineClass0(Native Method)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
   at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:292)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
   at .......


I DO have commons lang (2.0) in my $CATALINA_HOME/common/lib, so I don't understand this message...


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 20, 2003 5:58 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Welcome to the wonderful world of Tomcat vs. Servlet vs. JVM Standard classloading. Put it in WEB-INF/lib.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 20, 2003 12:05 pm 
Beginner
Beginner

Joined: Sat Sep 20, 2003 4:23 am
Posts: 48
christian wrote:
Welcome to the wonderful world of Tomcat vs. Servlet vs. JVM Standard classloading. Put it in WEB-INF/lib.


Still the same error :(

I'm getting frustrated here...


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 21, 2003 2:45 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
Try to find the first exeption, I think it will be "ExeptionInInitializerError" or some problem in linking, JVM throws "NoClassDefFoundError" after class initializer fails and you are trieng to access this class next time.
It looks like "NestableException" depends on package private classes and it can be caused by "IllegalAccessError", if you have two jars vissible for application.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 21, 2003 11:48 am 
Beginner
Beginner

Joined: Sat Sep 20, 2003 4:23 am
Posts: 48
there you go:

Code:
javax.servlet.ServletException: Error instantiating servlet class org.mathesis.test.HibernateTest
   at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1011)
   at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:712)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:188)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
   at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:256)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:210)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:196)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:175)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
   at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:974)
   at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:207)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:647)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:497)
   at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:575)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:649)
   at java.lang.Thread.run(Thread.java:554)


root cause:

Code:
java.lang.NoClassDefFoundError: org/apache/commons/lang/exception/NestableException
   at java.lang.ClassLoader.defineClass0(Native Method)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
   at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:292)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
   at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1286)
   at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1220)
   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
   at java.lang.Class.getDeclaredConstructors0(Native Method)
   at java.lang.Class.privateGetDeclaredConstructors(Class.java:1590)
   at java.lang.Class.getConstructor0(Class.java:1762)
   at java.lang.Class.newInstance0(Class.java:276)
   at java.lang.Class.newInstance(Class.java:259)
   at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1002)
   at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:712)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:188)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
   at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:256)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:210)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:196)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:175)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
   at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
   at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:974)
   at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:207)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:647)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:497)
   at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:575)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:649)
   at java.lang.Thread.run(Thread.java:554)


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 21, 2003 12:27 pm 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
Are you sure it is the first "init" after restart ? Looks like it is too late to read this stack trace, try to find more errors in log file.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 21, 2003 12:37 pm 
Beginner
Beginner

Joined: Sat Sep 20, 2003 4:23 am
Posts: 48
This is all I can find (just before the error):

Code:
2003-09-20 18:24:16 Marking servlet HibernateTest as unavailable
2003-09-20 18:24:16 StandardWrapperValve[HibernateTest]: Allocate exception for servlet HibernateTest


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 21, 2003 1:05 pm 
Beginner
Beginner

Joined: Sat Sep 20, 2003 4:23 am
Posts: 48
Oh, and this one is the actual first one:

Code:
2003-09-20 18:04:17 NamingContextListener[/Catalina/localhost/Mathesis]:   Resource parameters for UserTransaction = null


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 21, 2003 1:11 pm 
Beginner
Beginner

Joined: Sat Sep 20, 2003 4:23 am
Posts: 48
hm, dont't think the last one is relevant actually...


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 21, 2003 4:47 pm 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
Ilja wrote:
hm, dont't think the last one is relevant actually...

Looks like couse is lost, try to find duplicated jar or declare all methods in "NestableDelegate" as public, it can be "IllegalAccessErorr", JVM will throw this error if "NestableException" is loaded from "server/lib" but "NestableDelegate" is from "WEB-INF/lib".


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 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.