ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button
  EJB 2 and J2EE Packaging
Subject:   classloader and manifest file
Date:   2003-03-07 02:56:02
From:   src2001
Response to: classloader and manifest file

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 ???