You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Neil B. Cohen" <nc...@verisign.com> on 2009/03/09 16:44:38 UTC

Hibernate Exception...

I hope this is a trivial problem that someone can help me with...

I have been running a web app, built using Netbeans with Tomcat for 
months now. The system uses Hibernate for database access.
This week, I erased and rebuilt my desktop system - moved it from Fedora 
8 to Fedora 10. I re-installed Netbeans and Tomcat.
Netbeans rebuilds my program without any problem, but when I try to 
connect to the database (my login screen comes up fine)
I get this:

*Exception Handler *


*Description: * An unhandled exception occurred during the execution of 
the web application. Please review the following stack trace for more 
information regarding the error.

*Exception Details: * java.lang.NoClassDefFoundError
   Could not initialize class org.hibernate.ejb.Ejb3Configuration

*Possible Source of Error: *
    Class Name: /org.hibernate.ejb.HibernatePersistence/
    File Name: /HibernatePersistence.java/
    Method Name: /createEntityManagerFactory/
    Line Number: /124/

|Source not available. Information regarding the location of the 
exception can be identified using the exception stack trace below.
|


*Stack Trace: *

|org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:124)
javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52)
javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:34)
com.verisign.ncat.db.Ctl_User.getEntityManager(Ctl_User.java:36)
com.verisign.ncat.db.Ctl_User.validateUser(Ctl_User.java:46)
com.verisign.ncat.dm.User.validate(User.java:256)
com.verisign.ncat.jsp.Page1.b_Login_action(Page1.java:185)
sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-2)| 


and it goes on for several pages. Netbeans did not complain about 
missing libraries or missing classes. I have just downloaded the latest 
version of Hibernate and updated my libraries.


In /usr/local/Tomcat, I find this:
[ncohen@nbc-penguin Tomcat]$ find . |grep hibernate
./webapps/NCAT/WEB-INF/lib/hibernate-core.jar
./webapps/NCAT/WEB-INF/lib/hibernate-annotations.jar
./webapps/NCAT/WEB-INF/lib/hibernate-commons-annotations.jar
./webapps/NCAT/WEB-INF/lib/hibernate-entitymanager.jar

So the entity-manager is there as far as I can tell.

Can someone tell me what I need to do (or look for) to fix this problem??

Much obliged,

nbc

NAME:   Neil B. Cohen (Verisign Inc.)
PHONE:  703-948-4471
DOMAIN: ncohen@verisign.com
*************************************************************
* Murphy's Philosophy: Smile - tomorrow will be worse...
*
* O'Tooles Commentary: Murphy was an optimist!
*************************************************************




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Hibernate Exception...

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Neil,

On 3/9/2009 11:44 AM, Neil B. Cohen wrote:
> This week, I erased and rebuilt my desktop system - moved it from Fedora
> 8 to Fedora 10. I re-installed Netbeans and Tomcat.

[snip]

> *Exception Details: * java.lang.NoClassDefFoundError
>   Could not initialize class org.hibernate.ejb.Ejb3Configuration

You probably forgot to put your hibernate JDBC driver into Tomcat's lib
directory. If you are using Tomcat's JNDI DataSource, I believe you must
put the JDBC driver into Tomcat's lib directory.

You didn't mention your TC version, so:

5.5: usually in $CATALINA_BASE/common/lib
6.0: usually in $CATALINA_BASE/lib

Hope that helps,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkm5H2oACgkQ9CaO5/Lv0PBS9ACdE2hX8+RiqiYzVQunrctqq1ag
Ie4AoKtdKlMFtewSzb1d/mm2jbquVjQ1
=aJeU
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Hibernate Exception...

Posted by Ken Bowen <kb...@als.com>.
Clearly you're missing org.hibernate.ejb.Ejb3Configuration (and  
friends).

I'm running hibernate 3.2 (you should tell people your versions...it  
helps).  My eclipse tells me that org.hibernate.ejb.Ejb3Configuration  
lives in
hibernate-entitymanager.jar.

I seem to recall there being an issue about getting all the dependent  
files together.  If you are relying on Fedora, you might find some  
mismatches in versions.

--Ken

On Mar 9, 2009, at 11:44 AM, Neil B. Cohen wrote:

> Exception Details: * java.lang.NoClassDefFoundError
>  Could not initialize class org.hibernate.ejb.Ejb3Configuration


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org