-->
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.  [ 2 posts ] 
Author Message
 Post subject: hibernate + struts + tomcat big problem!!!
PostPosted: Fri Jul 29, 2005 8:44 am 
Newbie

Joined: Fri Jul 29, 2005 5:14 am
Posts: 1
Dear friends.
I've a problem with hibernate 2.I' m developing a Struts application who uses hibernate for persistence.The DB is Mysql 4 and Container is Tomcat 5.0.28.
I've created javabeans & DAOs with Hibernate Synchronizer plugin.

I've an action with this code

// load the configuration file
_BaseRootDAO.initialize();


RivistaDAO dao = new RivistaDAO();
List issues = dao.findAll();

and the relative Rivista.hbm is :

<hibernate-mapping package="net.rivista.hibernate">
<class name="Rivista" table="rivista">
<id
column="numero"
name="Numero"
type="integer"
>
<generator class="vm" />
</id>
<property
column="anno"
length="10"
name="Anno"
not-null="false"
type="integer"
/>
<set
inverse="true"
lazy="true"
name="ArticoliSet"
>
<key column="rivista_numero" />
<one-to-many class="Articoli" />
</set>
</class>
</hibernate-mapping>

THIS IS hibernate.cfg.xml

<hibernate-configuration>
<session-factory name="HsessionFactory">
<!-- local connection properties -->
<property name="connection.datasource">
java:comp/env/jdbc/rivista
</property>

<!-- property name="hibernate.connection.pool_size"></property -->
<!-- dialect for MySQL -->
<property name="dialect">
net.sf.hibernate.dialect.MySQLDialect
</property>
<property name="hibernate.show_sql">false</property>
<property name="hibernate.use_outer_join">true</property>

<mapping resource="Utenti.hbm" />
<mapping resource="Abbonamenti.hbm" />
<mapping resource="Articoli.hbm" />
<mapping resource="Rivista.hbm" />
<mapping resource="Redazione.hbm" />
<mapping resource="Country.hbm" />
</session-factory>
</hibernate-configuration>


When action executes retrives the following error:

java.lang.NoClassDefFoundError
net.sf.hibernate.impl.SessionFactoryImpl.<clinit>(SessionFactoryImpl.java:237)
net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:796)
net.rivista.hibernate.base._BaseRootDAO.initialize(_BaseRootDAO.java:54)
net.rivista.hibernate.base._BaseRootDAO.initialize(_BaseRootDAO.java:37)
net.rivista.azioni.AdminLoginAction.execute(AdminLoginAction.java:33)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

CAN YOU HELP ME?
THANKS


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 01, 2005 2:30 am 
Beginner
Beginner

Joined: Fri Feb 11, 2005 12:03 pm
Posts: 48
Location: Kiel, Germany
Hi,

did you copy the JDBC driver to the global classpath of Tomcat?
http://www.hibernate.org/hib_docs/reference/en/html_single/#quickstart

Can you catch the NoClassDefFoundError to get details about the missing class?


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