An EAR file (e.g. MyProj.ear) contains the following:
1. MyWebProj.war as a module
2. MyUtilProj.jar as a Project Utility Jar.
Now, MyWebProj.war calls classes from the jar file that are available under MyUtilProj.
In the development environment, the WebContent\WEB-INF\lib folder of MyWebProj does not physically contain the needed jar file that are in MyUtilProj. Instead, the MyWebProj.war has build-reference to MyUtilProj. MyWebProj compiles successfully and references the classes found in MyUtilProj.
When MyProj.ear is deployed, the MyWebProj can not find the jar files inside MyUtilProj.jar, even though MyUtilProj.jar is available as a Project Utrility jar in Myproj.ear. The deployment of MyProj.ear fails.
Obviously, the deployment would have been successful if the required jar files were physically copied in WebContent\WEB-INF\lib folder of MyWebProj.
But my goal is to be able to read the jar files (as present in MyUtilProj) from MyWebProj by not physically copying them again under WebContent\WEB-INF\lib folder of MyWebProj.
Is there any way to successfully deploy MyProj.ear by NOT physically copying the jar files from MyProjUtil in the WebContent\WEB-INF\lib folder of MyWebProj?
I am using WebSphere 6.1 test server as the application server.
Joined: Jul 21, 2003
As a note, I tried shared library approach, which did not work and did not deploy the EAR file either.
In the META-INF\MANIFEST.MF, I see the relevant jar files from MyUtilProj. I check the ones I need and save the MANIFEST.MF. The checked jar files never get saved. I am not sure why I can not save this MANIFEST.MF, after I have modified them. Manually additing the jar files on the source view of MANIFEST.MF does not save the file either.
I think you may need to change the classloader settings in the admin console. The deployed ear contains your project utility jar all jar'd up and in the EAR project. A web project is able to read from there.