<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    A Class-Path element in the META-INF/MANIFEST.MF of an ear is
    invalid.<br>
    You need to put it in the war.<br>
    <br>
    Carlo<br>
    <br>
    On 07/13/2011 01:12 PM, Francesco Marchioni wrote:
    <blockquote
cite="mid:CAFO5g=B5vDnN5ntGWELbjzxuXv+ERcSTodAj02EsqS+ONS1ayQ@mail.gmail.com"
      type="cite">Did some more tests today.<br>
      I've turned the utility.jar JAVA module into an EJB module and
      packed it<br>
      <br>
      enterprise.ear<br>
      | <br>
      |&nbsp;&nbsp; utility.jar&nbsp; (EJB Module)<br>
      |&nbsp;&nbsp; webapp.war&nbsp;&nbsp; <br>
      |<br>
      | META-INF/MANIFEST.MF<br>
      | META-INF/jboss-deployment-stucture.xml<br>
      <br>
      I've forced class isolation so that classes cannot be seen without
      a a Class-Path entry<br>
      &nbsp;
&lt;ear-subdeployments-isolated&gt;true&lt;/ear-subdeployments-isolated&gt;<br>
      <br>
      Now the EJB classes from utility.jar are successfully loaded by
      webapp.war --JUST-- Class-Path needs to be placed into the
      subdeployment module&nbsp; ( into webapp.war). When Class-Path is
      placed in the EAR/ META-INF/MANIFEST.MF the EJB classes fail to be
      loaded.<br>
      <br>
      Reproducing this test case is quite simple - I wonder if this can
      be classified as a bug.<br>
      Thanks<br>
      Francesco<br>
      <br>
      <div class="gmail_quote">2011/7/12 Francesco Marchioni <span
          dir="ltr">&lt;<a moz-do-not-send="true"
            href="mailto:marchioni.francesco@gmail.com">marchioni.francesco@gmail.com</a>&gt;</span><br>
        <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
          0.8ex; border-left: 1px solid rgb(204, 204, 204);
          padding-left: 1ex;">Sure.<br>
          <br>
          The sample.Test servlet (WebApp1.war) attempts to use the
          sample.Utility class (Utility.jar) packaged <br>
          <br>
          <br>
          16:23:58,576 ERROR
          [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/WebApp1].[sample.Test]]
          (http--127.0.0.1-8080-1) Servlet.service() for servlet
          sample.Test threw exception: java.lang.ClassNotFoundException:
          sample.Utility from [Module
          "deployment.EnterpriseApp.ear.WebApp1.war:main" from Service
          Module Loader]<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:358)<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330)<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:307)<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:101)<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at sample.Test.doGet(Test.java:36) [classes:]<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
          javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
          [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
          javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
          [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
          org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
          [jbossweb-7.0.0.CR4.jar:7.0.0.CR1]<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
          org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
          [jbossweb-7.0.0.CR4.jar:7.0.0.CR1]<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
          org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
          [jbossweb-7.0.0.CR4.jar:7.0.0.CR1]<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
          org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
          [jbossweb-7.0.0.CR4.jar:7.0.0.CR1]<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
          org.jboss.as.web.NamingValve.invoke(NamingValve.java:57)
          [jboss-as-web-7.0.0.CR1.jar:7.0.0.CR1]<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
          org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:49)
          [jboss-as-jpa-7.0.0.CR1.jar:7.0.0.CR1]<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
          org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154)
          [jbossweb-7.0.0.CR4.jar:7.0.0.CR1]<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
          org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
          [jbossweb-7.0.0.CR4.jar:7.0.0.CR1]<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
          org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
          [jbossweb-7.0.0.CR4.jar:7.0.0.CR1]<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
          org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)
          [jbossweb-7.0.0.CR4.jar:7.0.0.CR1]<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
          org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
          [jbossweb-7.0.0.CR4.jar:7.0.0.CR1]<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
          org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667)
          [jbossweb-7.0.0.CR4.jar:7.0.0.CR1]<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
          org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951)
          [jbossweb-7.0.0.CR4.jar:7.0.0.CR1]<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.lang.Thread.run(Thread.java:662) [:1.6.0_24]<br>
          <br>
          <br>
          META-INF/MANIFEST.MF is<br>
          <br>
          Manifest-Version: 1.0<br>
          Class-Path: Utility.jar<br>
          <br>
          (I've checked also without&nbsp; Manifest-Version: 1.0 declaration)<br>
          I guess tomorrow with some skull bash, will get it to work :-)
          )
          <div>
            <div class="h5">
              <br>
              <div class="gmail_quote"><br>
                <br>
                <br>
                2011/7/12 Jaikiran Pai <span dir="ltr">&lt;<a
                    moz-do-not-send="true" href="mailto:jpai@redhat.com"
                    target="_blank">jpai@redhat.com</a>&gt;</span><br>
                <blockquote class="gmail_quote" style="margin: 0pt 0pt
                  0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204);
                  padding-left: 1ex;">
                  Okay. Can you please post the entire exception
                  stacktrace? That'll give<br>
                  us an hint on what might be wrong. Also please post
                  the exact contents<br>
                  of the .ear/META-INF/MANIFEST.MF file.<br>
                  <br>
                  -Jaikiran<br>
                  <div>On Tuesday 12 July 2011 06:51 PM, Francesco
                    Marchioni wrote:<br>
                    &gt; &gt;Just to be clear, did that newline fix the
                    issue?<br>
                    &gt; Hi Jaikiran. No that didn't fix it. On the
                    other hand, the library is<br>
                    &gt; correctly picked up in the EAR/lib folder, just
                    not at the root of the<br>
                    &gt; archive.<br>
                    &gt;<br>
                  </div>
                  &gt; 2011/7/12 Jaikiran Pai &lt;<a
                    moz-do-not-send="true" href="mailto:jpai@redhat.com"
                    target="_blank">jpai@redhat.com</a> &lt;mailto:<a
                    moz-do-not-send="true" href="mailto:jpai@redhat.com"
                    target="_blank">jpai@redhat.com</a>&gt;&gt;<br>
                  <div>
                    <div>&gt;<br>
                      &gt; &nbsp; &nbsp; On Tuesday 12 July 2011 05:22 PM,
                      Francesco Marchioni wrote:<br>
                      &gt; &nbsp; &nbsp; &gt; yes, thanks I've added the newline
                      at the end of the Class-Path.<br>
                      &gt; &nbsp; &nbsp; Just to be clear, did that newline fix
                      the issue?<br>
                      &gt;<br>
                      &gt; &nbsp; &nbsp; -Jaikiran<br>
                      &gt;<br>
                      &gt; &nbsp; &nbsp; &gt;<br>
                      &gt; &nbsp; &nbsp; &gt; What I find odd, is that adding to
                      to jboss-deployment-structure.xml<br>
                      &gt; &nbsp; &nbsp; &gt; the resources element, deployment
                      fails because the Utility<br>
                      &gt; &nbsp; &nbsp; module has<br>
                      &gt; &nbsp; &nbsp; &gt; been already loaded.....<br>
                      &gt; &nbsp; &nbsp; &gt;<br>
                      &gt; &nbsp; &nbsp; &gt; &lt;jboss-deployment-structure&gt;<br>
                      &gt; &nbsp; &nbsp; &gt;<br>
                      &gt; &nbsp; &nbsp; &gt; &lt;deployment&gt;<br>
                      &gt; &nbsp; &nbsp; &gt;<br>
                      &gt; &nbsp; &nbsp; &gt; &lt;resources&gt;<br>
                      &gt; &nbsp; &nbsp; &gt; &lt;resource-root path="Utility.jar"
                      /&gt;<br>
                      &gt; &nbsp; &nbsp; &gt; &lt;/resources&gt;<br>
                      &gt; &nbsp; &nbsp; &gt; &lt;/deployment&gt;<br>
                      &gt; &nbsp; &nbsp; &gt;<br>
                      &gt; &nbsp; &nbsp; &gt; &lt;/jboss-deployment-structure&gt;<br>
                      &gt; &nbsp; &nbsp; &gt;<br>
                      &gt; &nbsp; &nbsp; &gt;<br>
                      &gt; &nbsp; &nbsp; &gt; Caused by:
                      org.jboss.msc.service.DuplicateServiceException:
                      Service<br>
                      &gt; &nbsp; &nbsp; &gt;<br>
                      &gt; &nbsp; &nbsp;
jboss.module.information.service."deployment.EnterpriseApp.ear.Utility.jar".main<br>
                      &gt; &nbsp; &nbsp; &gt; is already registered<br>
                      &gt; &nbsp; &nbsp; &gt;<br>
                      &gt; &nbsp; &nbsp; &gt; ......walking in the dark........<br>
                      &gt; &nbsp; &nbsp; &gt;<br>
                      &gt; &nbsp; &nbsp; &gt;<br>
                      &gt; &nbsp; &nbsp; &gt; 2011/7/12 Stuart Douglas &lt;<a
                        moz-do-not-send="true"
                        href="mailto:stuart.w.douglas@gmail.com"
                        target="_blank">stuart.w.douglas@gmail.com</a><br>
                      &gt; &nbsp; &nbsp; &lt;mailto:<a moz-do-not-send="true"
                        href="mailto:stuart.w.douglas@gmail.com"
                        target="_blank">stuart.w.douglas@gmail.com</a>&gt;<br>
                      &gt; &nbsp; &nbsp; &gt; &lt;mailto:<a moz-do-not-send="true"
                        href="mailto:stuart.w.douglas@gmail.com"
                        target="_blank">stuart.w.douglas@gmail.com</a><br>
                      &gt; &nbsp; &nbsp; &lt;mailto:<a moz-do-not-send="true"
                        href="mailto:stuart.w.douglas@gmail.com"
                        target="_blank">stuart.w.douglas@gmail.com</a>&gt;&gt;&gt;<br>
                      &gt; &nbsp; &nbsp; &gt;<br>
                      &gt; &nbsp; &nbsp; &gt; &nbsp; &nbsp; This should work, and there are
                      tests for this in the test<br>
                      &gt; &nbsp; &nbsp; suite.<br>
                      &gt; &nbsp; &nbsp; &gt; &nbsp; &nbsp; Are you missing a newline at the
                      end of the Class-Path: line in<br>
                      &gt; &nbsp; &nbsp; &gt; &nbsp; &nbsp; the manifest by any chance?<br>
                      &gt; &nbsp; &nbsp; &gt;<br>
                      &gt; &nbsp; &nbsp; &gt; &nbsp; &nbsp; For some really annoying reason
                      the JDK manifest processing<br>
                      &gt; &nbsp; &nbsp; stuff<br>
                      &gt; &nbsp; &nbsp; &gt; &nbsp; &nbsp; does not work unless there is
                      newline at the end of the file.<br>
                      &gt; &nbsp; &nbsp; &gt;<br>
                      &gt; &nbsp; &nbsp; &gt; &nbsp; &nbsp; Stuart<br>
                      &gt; &nbsp; &nbsp; &gt;<br>
                      &gt; &nbsp; &nbsp; &gt;<br>
                      &gt; &nbsp; &nbsp; &gt; &nbsp; &nbsp; On 12/07/2011, at 7:06 PM,
                      Francesco Marchioni wrote:<br>
                      &gt; &nbsp; &nbsp; &gt;<br>
                      &gt; &nbsp; &nbsp; &gt; &gt; Dear devs,<br>
                      &gt; &nbsp; &nbsp; &gt; &gt; I'm testing .ear classloading
                      with utility classes packaged in<br>
                      &gt; &nbsp; &nbsp; &gt; &nbsp; &nbsp; the Enterprise Archive.<br>
                      &gt; &nbsp; &nbsp; &gt; &gt; The following case test fails,
                      so I'm wondering if it's my<br>
                      &gt; &nbsp; &nbsp; &gt; &nbsp; &nbsp; misundertanding or a bug:<br>
                      &gt; &nbsp; &nbsp; &gt; &gt;<br>
                      &gt; &nbsp; &nbsp; &gt; &gt; application.ear<br>
                      &gt; &nbsp; &nbsp; &gt; &gt; |<br>
                      &gt; &nbsp; &nbsp; &gt; &gt; | &nbsp;Webapplication.war<br>
                      &gt; &nbsp; &nbsp; &gt; &gt; | &nbsp;Utility.jar<br>
                      &gt; &nbsp; &nbsp; &gt; &gt; |<br>
                      &gt; &nbsp; &nbsp; &gt; &gt; | &nbsp;META-INF/MANIFEST.MF<br>
                      &gt; &nbsp; &nbsp; &gt; &gt;<br>
                      &gt; &nbsp; &nbsp; &gt; &gt; Manifest file contains the Java
                      EE compliant dependency to the<br>
                      &gt; &nbsp; &nbsp; &gt; &nbsp; &nbsp; class Utility.jar<br>
                      &gt; &nbsp; &nbsp; &gt; &gt; Class-Path: Utility.jar<br>
                      &gt; &nbsp; &nbsp; &gt; &gt;<br>
                      &gt; &nbsp; &nbsp; &gt; &gt; However, the Webapplication
                      fails to load the classes from<br>
                      &gt; &nbsp; &nbsp; &gt; &nbsp; &nbsp; Utility.jar, which are instead
                      correctly pickedup if I move them<br>
                      &gt; &nbsp; &nbsp; &gt; &nbsp; &nbsp; into the ear's lib folder.<br>
                      &gt; &nbsp; &nbsp; &gt; &gt;<br>
                      &gt; &nbsp; &nbsp; &gt; &gt; As side note - I've tried also
                      stating isolated deployments to<br>
                      &gt; &nbsp; &nbsp; &gt; &nbsp; &nbsp; false, in
                      jboss-deployment-structure.xml (which should
                      default)<br>
                      &gt; &nbsp; &nbsp; &gt; &nbsp; &nbsp; without success:<br>
                      &gt; &nbsp; &nbsp; &gt; &gt;
                      &lt;jboss-deployment-structure&gt;<br>
                      &gt; &nbsp; &nbsp; &gt; &gt;
&lt;ear-subdeployments-isolated&gt;false&lt;/ear-subdeployments-isolated&gt;<br>
                      &gt; &nbsp; &nbsp; &gt; &gt;
                      &lt;/jboss-deployment-structure&gt;<br>
                      &gt; &nbsp; &nbsp; &gt; &gt;<br>
                      &gt; &nbsp; &nbsp; &gt; &gt; Any suggestion?<br>
                      &gt; &nbsp; &nbsp; &gt; &gt; Thanks a lot<br>
                      &gt; &nbsp; &nbsp; &gt; &gt; Francesco<br>
                      &gt; &nbsp; &nbsp; &gt; &gt;
                      _______________________________________________<br>
                      &gt; &nbsp; &nbsp; &gt; &gt; jboss-as7-dev mailing list<br>
                      &gt; &nbsp; &nbsp; &gt; &gt; <a moz-do-not-send="true"
                        href="mailto:jboss-as7-dev@lists.jboss.org"
                        target="_blank">jboss-as7-dev@lists.jboss.org</a><br>
                      &gt; &nbsp; &nbsp; &lt;mailto:<a moz-do-not-send="true"
                        href="mailto:jboss-as7-dev@lists.jboss.org"
                        target="_blank">jboss-as7-dev@lists.jboss.org</a>&gt;<br>
                      &gt; &nbsp; &nbsp; &lt;mailto:<a moz-do-not-send="true"
                        href="mailto:jboss-as7-dev@lists.jboss.org"
                        target="_blank">jboss-as7-dev@lists.jboss.org</a><br>
                      &gt; &nbsp; &nbsp; &lt;mailto:<a moz-do-not-send="true"
                        href="mailto:jboss-as7-dev@lists.jboss.org"
                        target="_blank">jboss-as7-dev@lists.jboss.org</a>&gt;&gt;<br>
                      &gt; &nbsp; &nbsp; &gt; &gt; <a moz-do-not-send="true"
                        href="https://lists.jboss.org/mailman/listinfo/jboss-as7-dev"
                        target="_blank">https://lists.jboss.org/mailman/listinfo/jboss-as7-dev</a><br>
                      &gt; &nbsp; &nbsp; &gt;<br>
                      &gt; &nbsp; &nbsp; &gt;<br>
                      &gt; &nbsp; &nbsp; &gt;<br>
                      &gt; &nbsp; &nbsp; &gt;<br>
                      &gt; &nbsp; &nbsp; &gt;
                      _______________________________________________<br>
                      &gt; &nbsp; &nbsp; &gt; jboss-as7-dev mailing list<br>
                      &gt; &nbsp; &nbsp; &gt; <a moz-do-not-send="true"
                        href="mailto:jboss-as7-dev@lists.jboss.org"
                        target="_blank">jboss-as7-dev@lists.jboss.org</a>
                      &lt;mailto:<a moz-do-not-send="true"
                        href="mailto:jboss-as7-dev@lists.jboss.org"
                        target="_blank">jboss-as7-dev@lists.jboss.org</a>&gt;<br>
                      &gt; &nbsp; &nbsp; &gt; <a moz-do-not-send="true"
                        href="https://lists.jboss.org/mailman/listinfo/jboss-as7-dev"
                        target="_blank">https://lists.jboss.org/mailman/listinfo/jboss-as7-dev</a><br>
                      &gt;<br>
                      &gt; &nbsp; &nbsp;
                      _______________________________________________<br>
                      &gt; &nbsp; &nbsp; jboss-as7-dev mailing list<br>
                      &gt; &nbsp; &nbsp; <a moz-do-not-send="true"
                        href="mailto:jboss-as7-dev@lists.jboss.org"
                        target="_blank">jboss-as7-dev@lists.jboss.org</a>
                      &lt;mailto:<a moz-do-not-send="true"
                        href="mailto:jboss-as7-dev@lists.jboss.org"
                        target="_blank">jboss-as7-dev@lists.jboss.org</a>&gt;<br>
                      &gt; &nbsp; &nbsp; <a moz-do-not-send="true"
                        href="https://lists.jboss.org/mailman/listinfo/jboss-as7-dev"
                        target="_blank">https://lists.jboss.org/mailman/listinfo/jboss-as7-dev</a><br>
                      &gt;<br>
                      &gt;<br>
                      &gt;<br>
                      &gt;<br>
                      &gt;
                      _______________________________________________<br>
                      &gt; jboss-as7-dev mailing list<br>
                      &gt; <a moz-do-not-send="true"
                        href="mailto:jboss-as7-dev@lists.jboss.org"
                        target="_blank">jboss-as7-dev@lists.jboss.org</a><br>
                      &gt; <a moz-do-not-send="true"
                        href="https://lists.jboss.org/mailman/listinfo/jboss-as7-dev"
                        target="_blank">https://lists.jboss.org/mailman/listinfo/jboss-as7-dev</a><br>
                      <br>
                      _______________________________________________<br>
                      jboss-as7-dev mailing list<br>
                      <a moz-do-not-send="true"
                        href="mailto:jboss-as7-dev@lists.jboss.org"
                        target="_blank">jboss-as7-dev@lists.jboss.org</a><br>
                      <a moz-do-not-send="true"
                        href="https://lists.jboss.org/mailman/listinfo/jboss-as7-dev"
                        target="_blank">https://lists.jboss.org/mailman/listinfo/jboss-as7-dev</a><br>
                    </div>
                  </div>
                </blockquote>
              </div>
              <br>
            </div>
          </div>
        </blockquote>
      </div>
      <br>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
jboss-as7-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:jboss-as7-dev@lists.jboss.org">jboss-as7-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/jboss-as7-dev">https://lists.jboss.org/mailman/listinfo/jboss-as7-dev</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>