• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to find the class in EAR file

 
surya sudhakar
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3892
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Simon Brown
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3892
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic