Allistair Crossley wrote:
Hi,
Hibernate needs a bunch of other jar files too. There is a text file in the H3
distrib indicating which are requisite and which are mandatory.
You do not menion whether this HibernateUtil you are using as a servlet has an
overridden init() method that creates the SessionFactory.
Finally, the way we set the Hibernate sub-system up here is to use a
ContextListener for our application which calls HibernateUtil.init which
instances the SessionFactory. Another way to go about Hibernate3 usage in web
apps is to use the Inversion of Control part of Spring.
Cheers, Allistair.
-----Original Message-----
From: David Haynes [mailto:[EMAIL PROTECTED]
Sent: 10 May 2005 19:30
To: tomcat-user@jakarta.apache.org
Subject: Help needed with Hibernate persistent servlet
I feel that I am almost there, but can't quite get the last
problem out
of the way.
I am using Tomcat 5.5.7, NetBeans 4.1rc2, and Hibernate 3.0.3.
I have set up the web.xml for my project to start the
HibernateUtil as a
load-on-startup servlet and confirmed that the proper libraries (jar
files) are in place under WEB-INF/lib. I know that the servlet is
running since I put the declaration into the global web.xml
and got back
the duplicate service error.
My problem is that I am getting NoClassDefFoundError. Looking at the
java generated for my jsp, I see that the class not found is the one
which references my persistent object. ( i.e. when I reference
HibernateUtil.currentSession() )
Do I need to do something else to make the persistent object
visible to
my jsp? The jsp does import my package containing
HibernateUtil and the
org.hibernate.* set as well.
Googling seems to indicate that getting this to work is an often seen
problem, but there not a lot of details about how to fix this. I have
checked all the fixes I can find but nothing seems to be working.
Thanks for any ideas/help.
-david-
Thanks for taking the time to try to help. It turns out to be a
documentation problem with Hibernate 3.0 in that one of the required jar
libraries is not documented as being required. Once I added the asm.jar
library, everything started to work properly.
-david-
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]