3 Replies Latest reply on Jan 3, 2016 12:32 AM by jaysensharma

    library ref from .war to .jar inside .ear

    garyaitken

      Hi all,

           

      This is clearly a newbie config question but my head is hurting from beating it against various walls...

      Trying to get an old (2010) app I know next to nothing about to run.

      Using wildfly 9.0.1 on fbsd.

       

      I have built a .ear which I suspect has incorrect xml descriptors in it;

        it contains a single .war and a .jar; the .war references a class in the .jar.

      When enabled in wildfly, I get a ClassNotFound exception.

      I thought the Class-Path reference in the war file should make it find the class in the jar file...

         

      Packaging is as follows:

      app.ear:

        META-INF/

        app.war:

          META-INF/

            MANIFEST.MF

              Class-Path: app.jar

          WEB-INF/

            jboss-web.xml

            web.xml

          classes/              (contains class referencing missing class)

          lib/                  (contains some .jar files needed by classes)

        app.jar:

          META-INF/

            jboss.xml

          classes/              (contains the missing org.abc.DMDSLLocalHome.class)

          lib/                  (contains .jar files needed by classes)

          ejb-jar.xml

          (other .xml files not yet relevant)

       

      2015-12-30 20:21:27,160 ERROR [org.jboss.as.controller.management-operation] (XNIO-1 task-5) WFLYCTL0013:

          Operation ("deploy") failed - address: ([("deployment" => "app.ear")]) - failure description:

          {"WFLYCTL0080: Failed services" => {"jboss.deployment.subunit.\"app.ear\".\"app.war\".POST_MODULE" =>

          "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"app.ear\".\"app.war\".POST_MODULE:

          WFLYSRV0153: Failed to process phase POST_MODULE of subdeployment \"app.war\" of deployment \"app.ear\"

          Caused by: java.lang.RuntimeException: WFLYEJB0087: Could not load view org.abc.DMDSLLocalHome

          Caused by: java.lang.ClassNotFoundException: org.abc.DMDSLLocalHome from [Module \"deployment.app.ear.app.war:main\" from Servic

      e Module Loader]"}}

       

      Any pointers / hints would be much appreciated.

        • 1. Re: library ref from .war to .jar inside .ear
          jaysensharma

          You should move the "org.abc.DMDSLLocalHome.class"    from the   "app.ear/app.jar/classes"   to  "app.ear/app.jar".   Usually we do not create a directory "classes" inside a JAR.  so better  to move all the classes from the "app.ear/app.jar/classes" to the root of that JAR like inside "app.ear/app.jar" and remove the "app.ear/app.jar/classes" directory.

           

          Also the Standard EAR  can have a directory "lib" where you can place all your JARs than needs to be shared across multiple sub-modules (like war/ejb-jar ..etc) of that EAR.



          Regards

          Jay SenSharma

          • 2. Re: library ref from .war to .jar inside .ear
            garyaitken

            Thanks, that got me a little further along.

            Now I need to deal with the EJB 2 => EJB 3 transition, since Wildfly 9 apparently doesn't support the arbitrary naming and mapping done via jboss.xml and ejb-jar.xml.  I've seen references to jboss-ejb3.xml, but no real explanation of it and how it may relate to jboss.xml and ejb-jar.xml.

            • 3. Re: library ref from .war to .jar inside .ear
              jaysensharma

              Good to know that your primary issue is resolved.

               

              EJB2 => EJB3 migration and mapping between jboss.xml and ejb-jar.xml and jboss-ejb3.xml   i will suggest you to post if you have any specific query/error/exception in that regard else going through the doc will help much.

               

              jboss-ejb3.xml Reference - WildFly 10 - Project Documentation Editor

               

              Regards

              Jay SenSharma