Every time I think I've finally figured out web app classpath resolution, there is a 
new surprise. My understanding of the situation follows. I'd appreciate it if somebody 
would correct me if I'm wrong.

Given the web app structure:

app.ear
  ejb.jar
  app.war
    app.jsp
    WEB-INF/
      classes/
        warcls.class
      lib/
        warlib.jar
  lib/
    earlib.jar
  conf/
    app.properties

app.war manifest classpath: ./lib/earlib.jar ./conf

system classpath: .;/libs/sys.jar

jboss lib/
  server.jar

then the following is the case:

app.jsp compilation can reference: warcls.class warlib.jar
app.jsp compilation can not reference: ejb.jar earlib.jar app.properties

A class in ejb.jar can reference: ejb.jar earlib.jar app.properties
A class in ejb.jar can not reference: warcls.class warlib.jar

A class in warlib.jar can reference: warcls.class warlib.jar earlib.jar app.properties
A class in warlib.jar can not reference: ejb.jar

warcls.class can reference: warlib.jar earlib.jar app.properties
warcls.class can not reference: ejb.jar

A class in earlib.jar can reference: earlib.jar app.properties
A class in earlib.jar can not reference: ejb.jar warcls.class warlib.jar

Everything can reference sys.jar before jboss 2.4.
Only app.jsp compilation can reference sys.jar in jboss 2.4.

app.jsp compilation cannot reference server.jar.
Everything else can reference server.jar.

Adding a classpath entry to the ejb.jar manifest has the same effect as adding it to 
the web.jar manifest, namely making it part of a shared deployment classloader visible 
to both ejb.jar and app.war.

The component manifest classpath mechanism is standard ejb container functionality and 
is not jboss-specific(?).

Adding a classpath entry to the app.ear manifest has no effect.

The only way to make a jar /lib/util.jar accessible without copying it or adding it to 
the system classpath is by adding the following entry to jboss.conf:

<MLET CODE = "org.jboss.util.ClassPathExtension" ARCHIVE="jboss.jar" 
CODEBASE="../../lib/ext/">
   <ARG TYPE="java.lang.String" VALUE="/lib/util.jar">
</MLET>

Is that right?

Heiko Dittrich wrote:

> Hello,
> it's true, jar-nesting does not work here. I was able to run the
> tomcat-test.ear finally by adding client.jar to the systems CLASSPATH.
> Of course it's not a solution.
>
> Where can I get the .java files from the tomcat-test.ear ?
>
> -----Urspr�ngliche Nachricht-----
> Von: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]Im Auftrag von Jung , Dr.
> Christoph
> Gesendet: Mittwoch, 18. Juli 2001 15:26
> An: '[EMAIL PROTECTED]'
> Betreff: AW: [JBoss-user] ear file manifest classpath problem ?
>
> Your log indicates that the embedded jar file is added to the classpath
> instead of an extracted version
> (something like
> file:C:\Devlpt\jboss-2.2\tmp\deploy\Default\lib\ejb-client.jar).
>
> If I remember right, java.net.URLClassLoader (even java.net.URL and the
> associated handlers, such as sun.net.www.protocol.jar.Handler) is not able
> to resolve things over one level of jar-nesting. It�s a shame, especially it
> will silently fail in this case ...
>
> Maybe it would be possible to indicate your additional jar as a "module" to
> the J2eeDeployer
>
>     <module>
>         <ejb>lib\ejb.client.jar</ejb>
>     </module>
>
> such that it will extract the ejb-client.jar as it does with your war and
> ejb-jar ingredients? But it is possible that the ContainerFactory will spout
> it out, then ... Hmm, think we need a more general
> module structure there ...
>
> Best,
> CGJ
>
> -----Urspr�ngliche Nachricht-----
> Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Gesendet: Mittwoch, 18. Juli 2001 14:53
> An: [EMAIL PROTECTED]
> Betreff: Re: [JBoss-user] ear file manifest classpath problem ?
>
> Hi, it seems that i've got the same kind of problem :
>
> I have package my application in a ear file containing :
>      - i have made a jar file for my session beans including the interfaces
> of the used entity beans (ejb-app.jar)
>      - i have made a jar file containing the interfaces of the application
> session beans  (lib/ejb-client.jar)
>      - i have made a war file containing all the servlets and pages for the
> web-application (web-app.war)
>
> This is my application.xml file :
>      <application>
>           <display-name>Frontend application</display-name>
>           <module>
>                <web>
>                <web-uri>web-app.war</web-uri>
>                <context-root>/frontend</context-root>
>                </web>
>           </module>
>           <module>
>                <ejb>ejb-app.jar</ejb>
>           </module>
>      </application>
>
> The content of my ear file is :
> %>jar cvf frontend.ear web-app.war ejb-app.jar lib/ejb-client.jar META-INF
> META-INF/application.xml
> added manifest
> adding: web-app.war(in = 8661) (out= 7880)(deflated 9%)
> adding: ejb-app.jar(in = 10508) (out= 8745)(deflated 16%)
> adding: lib/ejb-client.jar(in = 4208) (out= 3713)(deflated 11%)
> ignoring entry META-INF/
> adding: META-INF/application.xml(in = 261) (out= 138)(deflated 47%)
>
> In the war archive I have added a manifest file containg the following lines
> (with a cariage return at the end) :
> Manifest-Version: 1.0
> Class-Path: ./lib/ejb-client.jar
>
> The deployment seems to be good, this jar is added to common classpath :
> [J2EE Deployer Default] added
> jar:file:C:\Devlpt\jboss-2.2\tmp\deploy\Default\copy1001.zip!/lib/ejb-client
> .jar to common classpath
>
> I have got an exception (it concerning $Proxy6 class) when accesing from my
> servlet
> but all runs good when the client of my session beans is a distinct java
> application !
> This is the error :
>
> Exception in: R( /frontend + /servlet/DisplayPlansServlet + null) -
> java.lang.NoClassDefFoundError: $Proxy6
>         at
> sun.reflect.GeneratedSerializationConstructorAccessor64.newInstance(Unknown
> Source)
>         at java.lang.reflect.Constructor.newInstance(Unknown Source)
>         at java.io.ObjectStreamClass.newInstance(Unknown Source)
>         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
>         at java.io.ObjectInputStream.readObject0(Unknown Source)
>         at java.io.ObjectInputStream.readObject(Unknown Source)
>         at java.rmi.MarshalledObject.get(Unknown Source)
>         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:299)
>         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:279)
>         at javax.naming.InitialContext.lookup(Unknown Source)
>         at
> pcc.intranet.util.XmlModelerFactory.createXmlModeler(pcc/intranet/util/XmlMo
> delerFactory.java:89)
>         at
> pcc.intranet.frontend.sphf.servlet.DisplayPlansServlet.init(pcc/intranet/fro
> ntend/sphf/servlet/DisplayPlansServlet.java:82)
>         at
> org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317)
>         ....
>
> Is anyone knows how to solve this problem ... ?
> Is there something else to include in classpath ... ?
>

--
Fred Loney
Spirited Software, Inc.
[EMAIL PROTECTED]



_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to