File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

WebLogic 6.1 External Jars not found

 
Dan Jepp
Author
Ranch Hand
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Dan Jepp
Author
Ranch Hand
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic