-->
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.  [ 7 posts ] 
Author Message
 Post subject: Tomcat can't find org.hibernate.Session
PostPosted: Sat Feb 21, 2009 11:27 am 
Newbie

Joined: Sat Feb 21, 2009 10:45 am
Posts: 2
Hibernate version:3.3.1.GA

I'm using Tomcat 6.

I can compile my classes fine, but when I try to run the webapp, I get:

Code:
HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Error instantiating servlet class com.pkc.games.GamesServlet
   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
   org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
   org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
   org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
   java.lang.Thread.run(Thread.java:636)

root cause

java.lang.NoClassDefFoundError: org/hibernate/Session
   java.lang.Class.getDeclaredConstructors0(Native Method)
   java.lang.Class.privateGetDeclaredConstructors(Class.java:2406)
   java.lang.Class.getConstructor0(Class.java:2716)
   java.lang.Class.newInstance0(Class.java:343)
   java.lang.Class.newInstance(Class.java:325)
   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
   org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
   org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
   org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
   java.lang.Thread.run(Thread.java:636)

root cause

java.lang.ClassNotFoundException: org.hibernate.Session
   org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
   org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
   java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
   java.lang.Class.getDeclaredConstructors0(Native Method)
   java.lang.Class.privateGetDeclaredConstructors(Class.java:2406)
   java.lang.Class.getConstructor0(Class.java:2716)
   java.lang.Class.newInstance0(Class.java:343)
   java.lang.Class.newInstance(Class.java:325)
   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
   org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
   org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
   org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
   java.lang.Thread.run(Thread.java:636)


Here's my classpath:
Code:
me@mycomputer:~$ echo $CLASSPATH
.:/home/me/tomcat6/lib/servlet-api.jar:/home/me/tomcat6/lib/jsp-api.jar:/home/me/tomcat6/webapps:/home/me/tomcat6/lib/mysql-connector-java-5.1.6.jar:/home/me/tomcat6/lib/hibernate3.jar:


I was able to test my classes before dumping them into Tomcat and they persisted my test objects into MySQL perfectly fine. I can't figure out why Tomcat can't find Hibernate. I don't see any spelling errors or missing colons or anything!


Top
 Profile  
 
 Post subject: Can anyone tell me Regarding Tomcat and hibernate integratio
PostPosted: Mon Feb 23, 2009 7:51 am 
Newbie

Joined: Wed Feb 18, 2009 10:44 am
Posts: 3
Hi Everyone

I found no replies to this topic and related topics of this..Why i donno ?? :(

http://forum.hibernate.org/viewtopic.php?t=994782


Please tell me how can i integrate hibernate with tomcat !!

Main problem i am facing is starting session from tomcat..
Please see the above post..I am searching in net and not getting
right guidelines to start it..

May i know how can i start my hibernate session from aar file which is deployed rather than doing it from outside aar file [like copying my configuration files of hibernate into web-inf/classes and all hibernate libs to webinf\lib ..I tried this tooo but not working ??

So hoping for replies this time...

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 23, 2009 9:14 am 
Expert
Expert

Joined: Fri Jan 30, 2009 1:47 am
Posts: 292
Location: Bangalore, India
copy the hibernate libraries to your web-inf/lib

_________________
Regards,
Litty Preeth


Top
 Profile  
 
 Post subject: Litty Preeth
PostPosted: Mon Feb 23, 2009 9:44 am 
Newbie

Joined: Wed Feb 18, 2009 10:44 am
Posts: 3
Litty Preeth
Thanks for replying...But as i said above i did before only that i copied all hibernate libs to webinf\lib...

Please can you help me in providing some info or steps regarding
hibernate configuring with tomcat (In axis2)...I tried all the ways but i m not able to initiate the session. Its urgent !!!

Thanks

Anudeep


Top
 Profile  
 
 Post subject: Re: Litty Preeth
PostPosted: Mon Feb 23, 2009 8:51 pm 
Senior
Senior

Joined: Wed Sep 19, 2007 9:31 pm
Posts: 191
Location: Khuntien (Indonesia)
You can also put the library in your tomcat lib ($CATALINA_HOME/common/lib), but this way is not recommended. It can cause conflict if this lib exists in other project with different version

anudeep wrote:
Litty Preeth
Thanks for replying...But as i said above i did before only that i copied all hibernate libs to webinf\lib...

Please can you help me in providing some info or steps regarding
hibernate configuring with tomcat (In axis2)...I tried all the ways but i m not able to initiate the session. Its urgent !!!

Thanks

Anudeep


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 24, 2009 2:03 am 
Expert
Expert

Joined: Fri Jan 30, 2009 1:47 am
Posts: 292
Location: Bangalore, India
Hi anudeep,

I don't have any experience with axis. So I don't know how to set up aar files.

But have you tried simple web app in tomcat. For a simple web app or war to work, you just need the hibernate and dependent libs in WEB-INF\lib folder of your war. Have you tried this? If so plz post the contents of your WEB-INF\lib dir.

_________________
Regards,
Litty Preeth


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 09, 2009 5:42 am 
Newbie

Joined: Thu Apr 09, 2009 5:33 am
Posts: 1
Hi angus77
why not try to copy the hibernate jar file to the tomcat's lib path


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