Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to specify library need by EJB in same EAR file  RSS feed

 
Jessica Tan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • 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
  • 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" />


 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • 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.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!