my dog learned polymorphism*
The moose likes Websphere and the fly likes EARs, WARs, classpaths, and manifests Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "EARs, WARs, classpaths, and manifests" Watch "EARs, WARs, classpaths, and manifests" New topic

EARs, WARs, classpaths, and manifests

Soing Wang

Joined: Jul 15, 2003
Posts: 3
I am using WAS 4.0.4, and using Ant 1.5.3 for builds. I've got a couple of problems. First, I have a set of classes I use as a framework for both the web and ejb tiers that I package as, say fwk.jar. For the web tier, I just put the jar in my war's WEB-INF/lib. For the ejb tier, I want to put the jar in the manifest classpath (e.g. Class-Path: lib/fwk.jar). I have tried this, but no matter what, when the EJBs load, I get a ClassNotFoundException on the base EJB classes/interfaces.
I've seen a lot of posts about setting classpaths for various class loaders, and setting the JVM classpath works, but then leads to another problem, which is I also using the commons-logging/log4j classes, and wind up with a class loader issue ("Class org.apache.commons.logging.impl.Log4JCategoryLog does not implement Log"), since the web tier is loading one class with the JVM class loader and another with the web module loader. So what I would like to do is remove all my jars from WEB-INF/lib and place them in a shared lib directory in my EAR and use the manifest classpaths to reference what I need appropriately, but since the EJB tier isn't working, I need to figure out why.
My other issue is that when I enter a long classpath in the manifest, either jar or ant is splitting the line up into two lines (e.g.,
"Class-Path: foo.jar bar.jar foo-bar.jar" becomes
"Class-Path: foo.jar bar.jar foo-\n bar.jar"). Perhaps the second issue is causing a problem with the first, but if I simply take out the "foo-bar.jar" entry, the line stays intact, but the EJB tier still doesn't load the other two jars.
Soing Wang

Joined: Jul 15, 2003
Posts: 3
Oh, by the way, I'm using AE (not AEs or AEd) on Win2000 server, and the built-in JDK, although I have installed the Sun JDK 1.3.1-b7 and J2EE 1.3.1 separately on the same machine.
Nagendra Prasad
Ranch Hand

Joined: Jul 11, 2002
Posts: 219
What IDE are you using for your builds?
Is that WSAD? or some other eclipse derivative?

Best Regards,

Best Regards,<br />Nagendra Prasad.
Soing Wang

Joined: Jul 15, 2003
Posts: 3
I have an entity ejb jar built from WSAD, but aside from that, I'm trying to do the build outside of an IDE using Ant, with command line tools (i.e. javac, jar, ejbdeploy, wscp).
subject: EARs, WARs, classpaths, and manifests
Similar Threads
Need help using annotations with Axis2
NoClassDefFoundError problem with WAR in 8.1
Order in which class is searched
Tomcat not resolving external repository
MANIFEST.MF Class-Path Setting