• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Accessing common jar files in EAR

 
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have an EAR file. I would like to have a jar file which could be accessed by both EJB(JAR) and Web(WAR) modules with in the EAR. If i put this jar file in the top-level directory inside the .ear file is it accessible by both the EJB and Web modules? If not where should i put the common jar in EAR file to be accessed by both EJB and Web modules?

Thanks in Advance,
Srikanth.
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you place the JAR file in the base directory of the EAR, and include it in the application.xml file, then it will be available to both EJBs and WAR.

In 5.0, you could also place it in the lib directory within the EAR. Then you do not need to add it to the application.xml file. I am not sure if this scheme would work on 4.2.x.
 
Saathvik Reddy
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Peter Johnson:
If you place the JAR file in the base directory of the EAR, and include it in the application.xml file, then it will be available to both EJBs and WAR.

In 5.0, you could also place it in the lib directory within the EAR. Then you do not need to add it to the application.xml file. I am not sure if this scheme would work on 4.2.x.



Peter, It worked! but, just curious to know: If we add the jar file to the class path thru manifest files(Class-Path: common.jar) in ejb-jar and war files. is common.jar accessible to both the modules?
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Srikanth Reddy:
If we add the jar file to the class path thru manifest files(Class-Path: common.jar) in ejb-jar and war files. is common.jar accessible to both the modules?



I have never tried this (at least, not intentionally!) so do not know if it would work.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic