-->
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.  [ 1 post ] 
Author Message
 Post subject: NoClassDefFoundError with org.hibernate.cfg.Configuration
PostPosted: Sun Oct 03, 2010 1:19 pm 
Newbie

Joined: Sun Oct 03, 2010 12:49 pm
Posts: 1
Hi there,

I have a problem with initialising a google web toolkit (gwt) application using hibernate under tomcat.
When using the same application from eclipse, everything works fine.

The setup looks as follows:
I placed all needed jars under WEB-INF/lib.
The gwt server files are placed under WEB-INF/classes. The db persistency with hibernate is used in an external project that I pack in a separate jar file, also placed in WEB-INF/lib. The hibernate configuration file is placed under WEB-INF/classes, as described in various sources.

When doing a server call that uses the hibernate functionality I get the following error:

03.10.2010 17:07:20 org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Allocate exception for servlet login
java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.cfg.Configuration
at com.pugatsch.allstocks.db.p1.MyHibernateUtil.getSessionFactory(MyHibernateUtil.java:17)
at com.pugatsch.gwt.marketScanner.server.LoginImpl.initialize(LoginImpl.java:35)
at com.pugatsch.gwt.marketScanner.server.LoginImpl.init(LoginImpl.java:28)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:809)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:636)

The exception happens on line
Code:
Configuration configuration = new Configuration().configure();

in:
Quote:
public class MyHibernateUtil {
private static SessionFactory sessionFactory;
public static SessionFactory getSessionFactory() {
if (sessionFactory == null) {
try {
Configuration configuration = new Configuration().configure();
sessionFactory = configuration.buildSessionFactory();
} catch (Throwable ex) {
ex.printStackTrace();
throw new ExceptionInInitializerError(ex);
}
}
return sessionFactory;
}
}


Every help is appreciated.

Thanks,
Pascal


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.