-->
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: Deploying EJB and Hibernate on Weblogic
PostPosted: Thu Jan 19, 2006 11:01 pm 
Newbie

Joined: Wed Dec 14, 2005 10:47 pm
Posts: 11
Hi!

I'm using Hibernate 3.1 on Weblogic 8.1 SP 2. I have created an EJB that does nothing except to create an instance of my manager class for storage in memory on EJB creation. It deploys with no errors and successfully creates and stores the instance. However, the problem arises when I try to access the data. It throws a NoClassDefFoundError: org/hibernate/Session, which is found in its corresponding DAO class. It doesn't matter if I access the manager class from an external application using the cached instance or a new instance created within the application itself. It just fails when I'm trying to create an instance of the DAO class, which this manager class depends on and creates on its own. I have both the jar and war files, compressed in an ear file for deployment. The libraries used are stored in the war file, under WEB-INF/lib. The problem does not appear when I remove the jar portion, that is, deploying it as a web application enclosed in an ear file.

Regards,
Adrian


Top
 Profile  
 
 Post subject: Hibernate can't find .cfg.xml
PostPosted: Fri Jan 20, 2006 6:56 am 
Newbie

Joined: Wed Dec 14, 2005 10:47 pm
Posts: 11
Ok... I have solved the problem above but now I have a new problem. I have 2 applications, 1 with an EJB to create a cached copy of the manager class. I shall call this application App A and the other application, a web app deployed in an ear fille, App B. App B uses the cached copy of the manager class in App A, so is dependent on App A for some functions.

After the server is started, when I run any page in App A before running a page in App B that requires info from App A, everything works fine but if I run that page in App B before App A, I will get an ExceptionInInitializerError, saying it is unable to located the hibernate.cfg.xml file. Thereafter, both apps throw the same error regardless of the page visited.

Somehow I think the session factory is loaded only once and the applications use the same session factory. Is there a way to make the session factory work within the application and not shared? My session factory is created the same way as in the reference documentation's HibernateUtil class (page 14). Layout for both apps are as follows:
App A:
hibernate.jar and required jar files are located in EAR file's APP-INF/lib folder. hibernate.cfg.xml is located in META-INF folder.

App B:
hibernate.jar and required jar files are located in the WAR file's WEB-INF/lib folder. hibernate.cfg.xml is located in WEB-INF/classes folder.

Anybody has any idea on how to solve this problem?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 15, 2008 8:08 am 
Newbie

Joined: Fri Mar 14, 2008 4:20 am
Posts: 17
I have the same problem with the Borland Application Server. Did you find a solution?


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.