This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes can library jars be inside an ejb jar? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Reply Bookmark "can library jars be inside an ejb jar?" Watch "can library jars be inside an ejb jar?" New topic
Author

can library jars be inside an ejb jar?

Yuriy Zilbergleyt
Ranch Hand

Joined: Dec 13, 2004
Posts: 429
Hello,

Is there a place in an EJB jar's directory structure for other jars for use by the EJB? Something like the WEB-INF/lib in web applications?

Thank you,
Yuriy
Valentin Tanase
Ranch Hand

Joined: Feb 17, 2005
Posts: 704

Is there a place in an EJB jar's directory structure for other jars for use by the EJB? Something like the WEB-INF/lib in web applications?

Not really. Although different vendors offer different packing solutions and they have different classloading architectures for their containers, it is most common that the common library to be packed within the same ear (where the ejb goes) and edit the manifest file of each ejb-jar file. For example if you intend to make iText.jar and commons-collections.jar available to your ejbs, then you should add the next line to the MANIFEST.MF file of each ejb-jar that needs to use those libraries:

This example assumes that both iText.jar and commons-collections.jar libraries get packed into the ear�s root (otherwise you need to specify the proper path as well).
Regards.


I think, therefore I exist -- Rene Descartes
Yuriy Zilbergleyt
Ranch Hand

Joined: Dec 13, 2004
Posts: 429
All right, thanks!

-Yuriy
Valentin Tanase
Ranch Hand

Joined: Feb 17, 2005
Posts: 704
You're most welcome
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: can library jars be inside an ejb jar?
 
Similar Threads
How to add external jars to EJB project
Ejb deployment issue
application packaging for wehsphere 7-application and framework classes referred in both EJB and Web
EJB Deployment
complex deployment