EJB 2 and J2EE Packaging
Subject:   classloader and manifest file
Date:   2002-09-25 10:31:49
From:   anonymous2
Because web components don't support this extension, we still need multiple copies of the same jar (one in the ear file that the EJB jars can reference in their manifest, and one in the WEB-INF/lib directory of the war). So what is the point?

Based on this article and WebLogic document, I thought that I could do a "clean" package. But my testing seems to indicate otherwise.
Here is what I am doing:
I am using WebLogic 6.1. The documentation says, "the Web application classloader is a child of the EJB classloader" and the spec says that a child classloader first looks at its parent classloaders classpath.

So my question is, if I have a jar that contains my shared classes, and I have an EJB jar whose manifest references that jar, shouldn't my web application be able to access classes from the shared jar since its parent classloader is the EJB classloader (which should have the shared jar in its classpath because of the manifest entry)?

Full Threads Oldest First

Showing messages 1 through 1 of 1.

  • classloader and manifest file
    2003-03-07 02:56:02  src2001 [View]

    As per Weblogic Server 7.0 documentation:
    "Because it is common for Web Applications to call EJBs, the WebLogic Server application classloader architecture allows JavaServer Page (JSP) files and servlets to see the EJB interfaces in their parent classloader. ....If your application includes servlets and JSPs that use EJBs:
    Package the servlets and JSPs in a WAR file

    Package the enterprise beans in an EJB JAR file

    Package the WAR and JAR files in an EAR file

    Deploy the EAR file

    Although you could deploy the WAR and JAR files separately, deploying them together in an EAR file produces a classloader arrangement that allows the servlets and JSPs to find the EJB classes. If you deploy the WAR and JAR files separately, WebLogic Server creates sibling classloaders for them. This means that you must include the EJB home and remote interfaces in the WAR file, and WebLogic Server must use the RMI stub and skeleton classes for EJB calls, just as it does when EJB clients and implementation classes are in different JVMs."

    Does this mean that the EJB home and remote interfaces need not be packed in the WEB-INF/lib directory of the war file or referenced to in any way from the war file if the war and ejb jar are deployed together in the same ear? But if it is truely so then why does Weblogic 7.0 sample petstore contain all the ejb-client jars in the WEB-INF/lib directory of its war ???