-->
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.  [ 9 posts ] 
Author Message
 Post subject: hibernate .jars in .ear for JBoss 3.2.2RC3
PostPosted: Wed Oct 15, 2003 4:45 pm 
Regular
Regular

Joined: Wed Oct 15, 2003 4:40 pm
Posts: 67
Hello,

I have read the "Using Hibernate with JBoss" document and included the recommended .jar files (and put them in the manifest file), but I still get

WARN [org.jboss.ejb.EJBDeployer] Verify failed; continuing
java.lang.NoClassDefFoundError: net/sf/hibernate/HibernateException


when I try to deploy the ejb-jar using Hibernate contained in that .ear.

Anyone have a working set of jar:s to include (or any other hints)? I understood that the NoClassDefFoundError could come from almost any dependent .jar along the line


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 15, 2003 5:05 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
I use WebLogic instead of JBoss, but this is a pretty common issue. The way it works for me in WL (and it should also work in JBoss) is as follows:
1) generate my ejb-jar files with Class-Path entries in each ejb-jar manifest file with each of the jar files listed which this ejb grouping needs;
2) bundle the ear file with all the jar files referenced in the ejb-jar manifests loaded into the root of the ear file.

This also works for classes, resources, etc.

I did run into problems with the manifest Class-Path getting longer than one line. The jar spec has some crazy requirements regarding line length for manifest file entries. I cannot remember all the details, but the jist was a line neede to wrap at exactly 72 characters eith the proceeding line indented 1 space. The problems I ran into were (using Ant to generate these) with jar file names wrapping in the middle of the name.

The jar spec allows multiple Class-Path entries, so you should be able to avoid this by breaking up each jar into seperate entries, but the weblogic ejbc utility does not respect that part of the spec and only uses the last entry. If thats not a limit in JBoss, that thats all you need.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 15, 2003 5:28 pm 
Regular
Regular

Joined: Wed Oct 15, 2003 4:40 pm
Posts: 67
Tried splitting the Class-Path into multiple entries (it did seems to break in a bad place) in both the ear and ejb-jar manifest, and I still have the jars in the root of the .ear but no luck. The document mentions copying the jar:s to the server classpath but it shouldn't be neccessary. Or?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 15, 2003 8:49 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Steve,
It would be good to get a contrib page on setting this up for Weblogic as you mention issues for which it would be great to have more complete example documentation.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 15, 2003 9:54 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Thats a good idea. My issues were specific to WL 6.1. We are in the process of moving to WL 8.1, so I'll soon have some insight into that setup also...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 16, 2003 1:42 am 
Regular
Regular

Joined: Wed Oct 15, 2003 4:40 pm
Posts: 67
Nik wrote:
The document mentions copying the jar:s to the server classpath but it shouldn't be neccessary. Or?


Well I'll be damned, looks like the "Or?"-part should be applied. Copying the jars:s to the server lib helped! Looks like you should follow the instructions in the help document instead of just reading it ;-)

Now I'll go to the JBoss forums and bug them why this is required because I don't think this is normal behaviour...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 16, 2003 8:09 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
My JBoss setup includes the libs in the deploy directory. I have been meaning to stup the EAR as libs located in the EAR should work correctly. It is also a better solution. Everytime I upgrade its is pain. I will try it out and see how we go.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 16, 2003 8:15 am 
Regular
Regular

Joined: Wed Oct 15, 2003 4:40 pm
Posts: 67
david wrote:
My JBoss setup includes the libs in the deploy directory. I have been meaning to stup the EAR as libs located in the EAR should work correctly. It is also a better solution. Everytime I upgrade its is pain. I will try it out and see how we go.


Yes, I would also be interested in knowing how to make the EAR as stand-alone as possible, let me know how your experiment turns out. Could it be something with the order the classloading is done for the components?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 16, 2003 8:21 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Each version of JBoss has tended to have changes to the classloader. This is why I have left a working solution (although not ideal) as I generally have other things to do. Now I do understand that v3.2.x is better in this area so it worth trying it out. I will see how I go and update the wiki. The JBoss info is a little mixed up and should be better organised.


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