• 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

How to specify library need by EJB in same EAR file

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good Day.

I Need help...

I using OC4J 10g as app server. I had package few jar file (include ejb, client jar and other helper jar) to one EAR. During deploy, the problem I face is the EJB can't find the require classes, actually those classes are in the jar file package togather at same EAR file). How and where can I specify the jar I want to use?

I don't want to put those helper jar to classpath or app server common lib, it should have a way to specify the jar I need to use during deployment right? All jar are in one EAR, just don't know why OC4J can't find the require jar.

Any help on that problem?
 
Jessica Tan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Fix.

I just specify below line for the jar I need to use (in same EAR file with EJB) at orion-application.xml)

<library path="myjar.jar" />


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


I just specify below line for the jar I need to use (in same EAR file with EJB) at orion-application.xml)

<library path="myjar.jar" />


I�m not familiar with orion, but there is one pitfall you�d like to avoid: don�t add the common libraries to the system classpath; this will require restarting the server if these libraries change and you�ll lose all the deployment capabilities that your app server provides.


I don't want to put those helper jar to classpath or app server common lib, it should have a way to specify the jar I need to use during deployment right? All jar are in one EAR, just don't know why OC4J can't find the require jar.


Yes Jessica you right, there is a way to pack common libraries within the same ear. Unfortunately J2EE doesn�t specify any standard folder (like WEB-INF/lib for web app) from where the ear class loader could load common libraries. Therefore you have to turn to the manifest files. Hence you�ll pack the common libraries within your ear, let�s say in the ear�s root, just like your ejb. Finally edit the MANIFEST.MF of all your ejb-jar files (that need to include the common libs) to include this line:

Where common1.jar and common2.jar are all common libraries.
Regards.
reply
    Bookmark Topic Watch Topic
  • New Topic