wood burning stoves 2.0*
The moose likes Websphere and the fly likes WAS 5.1 Classloaders Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "WAS 5.1 Classloaders" Watch "WAS 5.1 Classloaders" New topic
Author

WAS 5.1 Classloaders

Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

I'm getting some strange behavior with WAS 5.1 and finding resources. I deploy an EAR, which contains a WAR, an JAR of EJBs and the necessary 3rd party JAR libraries common to both the web layer and the ejb layer. The WAR contains an implementation of ServletContextListener which does some config stuff when the web app is started, for which it relies on these 3rd party libraries and a config file deployed in the EJB JAR file. However I'm getting NullPointerExceptions and NoClassDefFoundExceptions from the ServletContextListener when it tries to use one of these common files. I can deploy this fine in other application servers, and I have always understood that EAR files are largely used to bundle up all the applciation components and dependencies for easy deployment. Can anyone explain what's going on?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Sudhir Meduri
Greenhorn

Joined: May 28, 2003
Posts: 22
I assume you must be having the common jars in a seperate directory
provide that path in the WEB and EJB MANIFEST.MF file.

Class-Path: dir/Common.jar

Please let us know how did it go

Thanks
Sudhir


Thanks,<br />Sudhir <br />SCJP1.4
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

The Manifest is relative to the root of the WAR file though - I don't see how I can set a Class-path entry in therte for something outside of the WAR.
Sudhir Meduri
Greenhorn

Joined: May 28, 2003
Posts: 22
hmm..

path of mycommon/common.jar needs to be relative to the root of the EAR file

Try this:

In the Manifest file for the Web.war
Manifest-Version:1.0
add this line
Class-Path: mycommon<relative_to_ear>/common.jar
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Yes that's how I'd expect it to work. Unfortunately it doesn't. If I watch a trace of the classloaders the manifest is just ignored (even if I include some junk it should at least complain about).
Sudhir Meduri
Greenhorn

Joined: May 28, 2003
Posts: 22
Strange!!

The only thing I could think of with out the log feed back is to try edit the manifest using the Assembly tookit instead of manual editing(technically shouldn't make a diff but never know)
I'll try my side too.
 
wood burning stoves
 
subject: WAS 5.1 Classloaders
 
Similar Threads
Class loading issue when "Package" names are same (WEB-INF/classes and WEB-INF/lib)
Using log4j in EAR module
EAR deployment problem Weblogic Migration... additional resources needed on classpath
NoClassDefFoundError
Regarding deployment on Websphere App server