aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Unable to find the class in EAR file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Unable to find the class in EAR file" Watch "Unable to find the class in EAR file" New topic
Author

Unable to find the class in EAR file

surya sudhakar
Greenhorn

Joined: Jun 11, 2002
Posts: 18
Hi all,
My application has around six ejb's all make use of some common classes. So what I did is jared all those common clases files. I kept that jar file in the EAR file and deployed the application. At runtime I am not able to find out the classed which are there in the common classes jar file.
Did the EJB specification say anything regarding where to put the common class files. If so how to package them.
Is this packaging is specific to the app server classloader implementation, if so how to tackle this problem in WebSphere.
Can you throw some light on how to package those kind of classes.
Thanks in advance.
Vydeek
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
You generally have to modify the manifest of the EJB-JAR files to let them know to look in the "common" jar file. See this book excerpt for details and examples.
Read this articlefor some useful pros and cons on various ways of sharing common code.
Kyle


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
Simon Brown
sharp shooter, and author
Ranch Hand

Joined: May 10, 2000
Posts: 1913
    
    6
"vydeek",
Thanks for joining JavaRanch, but could you just take a quick look at the naming policy and edit your profile.
Also, only members with valid names will be eligible for the book giveaways.
Thanks
Simon
surya sudhakar
Greenhorn

Joined: Jun 11, 2002
Posts: 18
Thanks,
the url you gave are very informative. I've tried the class path in manifest file, it is working now. Should I follow the same approach if the web module need the common jar file.
One approch is I can copy the commmon jar in the lib folder of the WEB-INF. Is there any other approch so that I can avoid copying the common jar into WEB-INF/lib.
Thanks
Vydeek
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
Originally posted by vydeek:
Thanks,
the url you gave are very informative. I've tried the class path in manifest file, it is working now. Should I follow the same approach if the web module need the common jar file.
One approch is I can copy the commmon jar in the lib folder of the WEB-INF. Is there any other approch so that I can avoid copying the common jar into WEB-INF/lib.
Thanks
Vydeek

Putting the common JAR file reference in the manifest of a WAR file works too. That's the best way to handle this kind of thing.
Kyle
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to find the class in EAR file