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

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

    jsebfranck Newbie



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



      |--- 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 :






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

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



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


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





      But I have still the same error.


      Thanks in advance for any help,