3 Replies Latest reply on Feb 11, 2015 8:36 AM by Lloyd Meinholz

    help debugging ear deployment

    Lloyd Meinholz Newbie

      I am migrating an ear application that was originally developed on glassfish, then migrated to TomEE and now I am migrating it to Wildfly 8.2.0. Wildfly is running in standalone mode and using JDK 1.7.0_76. The application uses Java EE 7 and has 3 web modules and an ejb module. I am having problems with one of the web modules (MyappWeb), which depends on the ejb module (MyappModel). The error messages that I am getting in the wildfly log are not helping me. The relevant part of the error is:

       

      Caused by: org.jboss.modules.ModuleNotFoundException: MyappModel:main

       

      In the pom for the ear, I have MyappModel and MyappWeb listed as dependencies. In the pom for the MyappWeb web module, I also have MyappModel listed as a dependency. eclipse/JBoss Tools show no errors. I am able to build the ear with maven and deploy it to Wildfly via the admin console. Enabling the deployment from the admin console is when I get the error.

       

      When I explode the ear, I see all the modules as expected. I tried building the ear leaving out the MyappWeb module and I was able to deploy and enable that ear. So I think the problem is with the access to MyappModel, not necessarily MyappModel itself.

       

      When I set the debug level of Wildfly to ALL, I get lots more information, but no additional details about what is causing the ModuleNotFoundException.

       

      I created a sample project using the jboss-javaee6-webapp-ear archetype and used that as a basis for my migration. It seems to me that I am doing things mostly the same as the sample project.

       

      Does anyone have any ideas what could be wrong or how to debug this issue further? Thanks.

        • 1. Re: help debugging ear deployment
          Tomaz Cerar Master

          Lloyd Meinholz wrote:

           

          Caused by: org.jboss.modules.ModuleNotFoundException: MyappModel:main

           

          In the pom for the ear, I have MyappModel and MyappWeb listed as dependencies. In the pom for the MyappWeb web module, I also have MyappModel listed as a dependency. eclipse/JBoss Tools show no errors. I am able to build the ear with maven and deploy it to Wildfly via the admin console. Enabling the deployment from the admin console is when I get the error.

           

          Why are you adding your submodules as dependency entries into manifest.mf? no need to do that.

          by ee spec inside EAR you should use Class-Path entry.

           

          Dependencies entry is wildfly / AS7 specific and is useful when you want to depend to other system modules (think of it as static / global libs)

           

          i think if you remove all dependencies entries from all manifest files it should deploy or at least it will give you different problem from which we can go on.

          • 2. Re: help debugging ear deployment
            Lloyd Meinholz Newbie

            I'm not creating the manifest.mf directly, maven is creating that via its ear, ejb and war plugins. The manifest.mf that is created for each of the modules are all empty. This is pretty much what the project I created with the jboss-javaee6-webapp-ear archetype looks like also.

            If I remove the dependencies from the ear's pom.xml, the project is empty (no projects included in the ear). If I remove the dependency for the MyappModel from MyappWeb's pom.xml, then the project will not compile.

            Thanks for your reply.

            • 3. Re: help debugging ear deployment
              Lloyd Meinholz Newbie

              In case anyone else runs in to this...

               

              Thanks Tomaz for getting me pointed in the right direction. The issue was related to the missing Class-Path entry in the maven generated MANIFEST.MF. I added:

               

              <configuration>

                <archive>

                  <manifest>

                    <addClasspath>true</addClasspath>

                  </manifest>

                </archive>

              </configuration>

              to the maven-war-plugin section of my pom.xml and the Class-Path entries were created.

               

              What I don't understand is why a simple app created with the jboss-javaee6-webapp-ear archetype didn't require the <archive> entry, but mine did. I guess once you start having more dependencies you need to be explicit.