1 Reply Latest reply on Feb 21, 2017 10:29 AM by Anup Dey

    ear deployment works from maven command line, but fails from IDE

    leor amikam Newbie

      I have a pretty standard ear project, including ejb and jax-ws in war file.  Running EAP 7.0 with standalone-full config.  If I build the project using maven only from command line (mvn clean install), I can deploy

      the resulting ear file with no problem.  However, when I use JBoss devstudio 10, I get the exception below.

       

      ([("deployment" => "HansenIntegtationFramework.ear")]) - failure description: {

          "WFLYCTL0080: Failed services" => {

              "jboss.deployment.subunit.\"HansenIntegtationFramework.ear\".\"HansenIntegrationFramework-ejb-1.0.jar\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"HansenIntegtationFramework.ear\".\"HansenIntegrationFramework-ejb-1.0.jar\".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of subdeployment \"HansenIntegrationFramework-ejb-1.0.jar\" of deployment \"HansenIntegtationFramework.ear\"

          Caused by: java.lang.NoClassDefFoundError: Failed to link com/hsntech/hif/logging/HIFLogData (Module \"deployment.HansenIntegtationFramework.ear:main\" from Service Module Loader): org/apache/logging/log4j/message/MapMessage",

              "jboss.deployment.subunit.\"HansenIntegtationFramework.ear\".\"HansenIntegrationFramework-web-1.0.war\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"HansenIntegtationFramework.ear\".\"HansenIntegrationFramework-web-1.0.war\".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of subdeployment \"HansenIntegrationFramework-web-1.0.war\" of deployment \"HansenIntegtationFramework.ear\"

          Caused by: java.lang.NoClassDefFoundError: org/apache/logging/log4j/Logger

          Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.Logger from [Module \"deployment.HansenIntegtationFramework.ear.HansenIntegrationFramework-web-1.0.war:main\" from Service Module Loader]

       

      ear contains a lib folder, and I see the required jar file.  Why the difference in behavior?

       

      Thanks

        • 1. Re: ear deployment works from maven command line, but fails from IDE
          Anup Dey Apprentice

          Hi,

           

          Looks like moving api module and adding dependencies as well as adding load to standealone.xml fixes it:

           

          org/apache/logging/log4j/api/main/module.xml for the api:

           

          <?xml version="1.0" encoding="UTF-8"?>

          <module xmlns="urn:jboss:module:1.1" name="org.apache.logging.log4j.api">

            <resources>

                  <resource-root path="log4j-api-2.5.jar"/>

              </resources>

          </module>

           

          org/apache/logging/log4j/core/main/module.xml for the core:

           

           

          <?xml version="1.0" encoding="UTF-8"?>

          <module xmlns="urn:jboss:module:1.1" name="org.apache.logging.log4j.core">

            <resources>

                  <resource-root path="log4j-core-2.5.jar"/>

              </resources>

           

            <dependencies>

            <module name="org.apache.logging.log4j.api"/>

            <module name="javaee.api"/>

            </dependencies>

          </module>

           

          org/apache/logging/log4j/web/main/module.xml for the core:

           

           

          <?xml version="1.0" encoding="UTF-8"?>

          <module xmlns="urn:jboss:module:1.1" name="org.apache.logging.log4j.web">

            <resources>

                  <resource-root path="log4j-web-2.5.jar"/>

              </resources>

           

            <dependencies>

                  <module name="org.apache.logging.log4j.api"/>

            <module name="org.apache.logging.log4j.core"/>

          <module name="javax.servlet.api"/>

            </dependencies>

          </module>