This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes BEA/Weblogic and the fly likes WebLogic 6.1 External Jars not found Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "WebLogic 6.1 External Jars not found" Watch "WebLogic 6.1 External Jars not found" New topic
Author

WebLogic 6.1 External Jars not found

Dan Jepp
Author
Ranch Hand

Joined: Jul 17, 2001
Posts: 39
Hi,
I am deploying an EAR containing my EJB Jars and a webapp WAR file.
I have been using the manifest file from each of the EJB JAR files to sort out any dependancies with no trouble.
The problem that i am now having is that third party jars required by the webapp are not being picked up from the WEB-INF/lib directory inside the WAR file as expected?
The WAR works fine under Tomcat.
Has anybody else found this? Its very strange as it is very simple and isn't working.
Thanks


Author <a href="http://www.amazon.com/exec/obidos/tg/detail/-/1861007701/qid=1038470361/sr=1-2/ref=sr_1_2/002-5433093-9410428?v=glance&s=books" target="_blank" rel="nofollow">Professional SCWCD Certification</a>
Dan Jepp
Author
Ranch Hand

Joined: Jul 17, 2001
Posts: 39
I have solved this problem after a lot of head scratching.
J2EE apps have 2 class loaders one for the EJB's and the second for the Webapps. The Webapp class loader is a subclass of the EJB Classloader.
I had all of my source in a jar file at the root level of the EAR file so that the EJB's could find any dependencies (Value objects etc) via the Class-Path: Manifest element.
As the EJB class loader is invoked first it was loading my class that accesses the third party jar (stored in the WAR's WEB-INF/lib). When the Webapp classloader gets its turn it does not load any classes that have already been loaded (why should it bother).
Because of this when the classs that attempts to access the third party jar is accessed it is the version inside the classes.jar at the root of the EAR that is executed and yes you have guessed it, it cannot find the third party jar as it is inside the WAR which it cannot access!
The solution was therefore make sure there were no duplicate classes in the EAR and WAR (i the WEB app or EAR only contains necessary files)
A tricky one!
Dan
chris kelly
Greenhorn

Joined: Jul 11, 2001
Posts: 6
Hi Dan,
Just to clarify things, you have your presentation logic in the WAR and business logic in the EAR jars. So if I had a value object that was needed in the presentation layer, would I have to include this in the WAR as well as the EAR so that it was properly loaded by both classloaders?
Thanks in advance.


Sun Certified Java Developer <br />Sun Web Component Java Developer<br />Sun Certified Java Programmer
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: WebLogic 6.1 External Jars not found