4 Replies Latest reply on May 4, 2010 8:13 AM by hehe64310

    EAR deployment problem

      Hi,

       

      I have created a small sample EAR project which contains an EJB jar and a web client (war) for the EJB.

      On deployment I get this error:

       

      java.lang.ClassCastException: org.jboss.metadata.ear.spec.EjbModuleMetaData cannot be cast to org.jboss.metadata.ear.spec.WebModuleMetaData

       

      This is the layout of the ear file:

       

      EAR

           EJB3Test.jar

           EJB_Test_Client.war

           META-INF

                application.xml

                MANIFEST.MF

       

      The file itself is attached.

      What could be the caus of the error?

       

      Cheers,

      Matt

        • 1. Re: EAR deployment problem
          jaikiran

          The .war file contains a META-INF/MANIFEST.MF with a Class-Path attribute:

           

          Class-Path: EJB3Test.jar

          We have some known issues with Class-Path attributes in MANIFEST.MF. Remove that entry from the MANIFEST.MF

          • 2. Re: EAR deployment problem
            wolfgangknauf

            Hi,

             

            you have a JavaEE5 app I assume? I ask because your "EJB3Test.jar" contains a web.xml AND Entity beans. But the feature of bundling EJBs in a WAR file is a feature of JavaEE6.

             

            So, either split EJB3Test.jar to an EJB jar and a WAR file, or (if you didn't intend to build a web module) clean it up: remove the "web.xml" folder, and your application.xml points to a web module.

             

            Best regards

             

            Wolfgang

            • 3. Re: EAR deployment problem
              jaikiran

              Wolfgang Knauf wrote:

               

              I ask because your "EJB3Test.jar" contains a web.xml AND Entity beans.

              Ah, that's a good point! I did not notice that the .jar was containing web.xml and .war related contents.

              • 4. Re: EAR deployment problem

                Thank you very much for pointing me at this. It was a stupid mistake: I have simple overlooked the WEB-INF folder containing the web.xml.

                Now that I have removed that folder everything works as expected.

                 

                Thank you!