-->
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.  [ 3 posts ] 
Author Message
 Post subject: Initial SessionFactory creation failed. NoClassDefFound
PostPosted: Wed Oct 18, 2006 9:17 am 
Newbie

Joined: Mon Sep 18, 2006 6:34 am
Posts: 18
Hi,

I'm running Hibernate deployed on WebLogic 8.1 and am deploying hibernate3.jar with my ear file.

As soon as the bean code hits the HibernateUtil class to set up the session e.g.

if (HibernateUtil.currentSession() == null) {
System.out.println("Session is null");
} else {
System.out.println("Session is not null");
}

, the following error is generated:

Initial SessionFactory creation failed.java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration

From the looks of things, it seems that hibernate3.jar cannot be located but from my understanding, if the jar is included in the ear, then WebLogic should automatically use the jar and add it to it's classpath.
I've also tried copying the hibernate3.jar to the weblogic server/lib dir but again no luck.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 18, 2006 11:47 pm 
Beginner
Beginner

Joined: Tue Sep 26, 2006 11:46 pm
Posts: 33
Generally Appservers only load Jars from the EAR if they're explicitly referenced by the Classpath property in the Manifest.MF of another jar or war that's being loaded.

That is, jars referenced as EJB jars and WARs are loaded then all the jars they depend on (according to the Classpath property in the Manifest) are loaded, and so on until all required jars are loaded.

I'm not sure if this is the case with WebLogic but it's something to check.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 19, 2006 3:44 am 
Newbie

Joined: Mon Sep 18, 2006 6:34 am
Posts: 18
Cheers for the info EdC, checked the manifest file for the ear file and hibernate3. jar was missing from the classpath attribute for the manifest.

However, even with that repaired I'm still getting the same problem i.e.:
Initial SessionFactory creation failed.java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration

Hibernate3.jar is the first of many hibernate required jars to be included in the ear and I'm wondering if it's reporting this error because one of the other required jars could be missing? That's clutching at straws though, as the exception explicity specifies org/hibernate/cfg/Configuration


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