tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allistair Crossley" <>
Subject RE: Help needed with Hibernate persistent servlet
Date Wed, 11 May 2005 08:02:23 GMT

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 []
> Sent: 10 May 2005 19:30
> To:
> 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-
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

QAS Ltd.
Developers of QuickAddress Software
<a href=""></a>
Registered in England: No 2582055
Registered in Australia: No 082 851 474

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message