Using external library jar

Hi everyone,

I am working on a J2EE 1.3 project. I have a external library jar file at, for example, /myproject/lib. My EAR has to access that external library jar. Moreover, the library jar is not self-contained. It has to use the class that stored in the EAR file.

I have seen a lot of articles that talking about using Class-Path attribute in the manifest file but that seem not work in my case.

Could any one have any idea how I can call a external library jar file which is not self-contained under J2EE 1.3 spec? Thank you very much.

Jacky

[576 byte] By [jackychana] at [2007-11-27 5:23:31]
# 1

Hi Jacky,

Just to be clear, you're talking about a library .jar that resides within the .ear itself, not external to the

.ear, correct?What exact problem did you encounter when trying to use the manifest classpath

approach?

In J2EE 1.4 and earlier, the only portable way to ensure that common application code outside of an

ejb-jar,.war, or application-client.jar (but still within the .ear) is visible to a particular module is to

1) package the code as a library .jar somewhere within the .ear

2) set the manifest classpath of each module that needs access to the .jar to point to the library .jar

It's best to partitiion the code such that the library code does not have dependencies on code

packaged within the modules themselves.

ksaksa at 2007-7-12 11:49:25 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
HI kasksUnfortunately, my jar is outside the ear. Is there any way to access that jar?Thank you.Jacky
jackychana at 2007-7-12 11:49:25 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3

In J2EE 1.3 there was no portable mechanism for extending the appserver-wide classpath of

a J2EE appserver.However, most appserver's have some way of doing it. You'll need to

consult the documentation of whatever implementation you're using.

However, in that case you cannot have code in the appserver classpath with dependencies on

code in a specific J2EE application.The dependency can only occur in the other direction.

--ken

ksaksa at 2007-7-12 11:49:25 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 4
Hi Ken,Thank you.Jacky
jackychana at 2007-7-12 11:49:25 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...