4 Replies Latest reply on Jun 22, 2012 2:57 AM by jaikiran

    AS7 "Failed to define class" error with jboss-deployment-structure configuration

    jsebfranck

      Hi,

       

      I'm trying to deploy an ear containing one war and two jar :

       

      myear.ear

      |--- mywebapp.war

      |--- myjar1.jar

      |--- myjar2.jar

       

      The jar myjar1.jar uses classes of the jar myjar2.jar. I have the following error during the deployment :

       

      (MSC service thread 1-5) Failed to define class com.xxxxxxxx in Module "deployment.myear.ear.myjar1.jar:main" from Service Module Loader: java.lang.LinkageError: Failed to link com.xxxxxxxxx (Module "deployment.myear.ear.myjar1.jar:main" from Service Module Loader)

      ...

      Caused by: java.lang.NoClassDefFoundError: com/xxxxxxxxxx

       

      So I tried to configure the dependencies between both jar in the META-INF/jboss-deployment-structure.xml file :

       

      <jboss-deployment-structure>

        <ear-subdeployments-isolated>false</ear-subdeployments-isolated>

        <deployment>

          <dependencies>

            <module name="deployment.myear.ear.myjar1.jar" />

            <module name="deployment.myear.ear.myjar2.jar" />

          </dependencies>

        </deployment>

        <sub-deployment name="myjar1.jar">

          <dependencies>

            <module name="deployment.myear.ear.myjar2.jar" />

          </dependencies>

        </sub-deployment>

      </jboss-deployment-structure>

       

      But I have still the same error.

       

      Thanks in advance for any help,