2 Replies Latest reply on Oct 9, 2015 9:29 AM by Sandeep Kumar

    Jboss EAP 6.3 ear fails but war works.

    Sandeep Kumar Newbie

      I have war file, reasteasy spring service.

      When i deploy it on server all works fine, but when i package it in a ear file it fails with exception

      Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener from [Module "deployment.xxxxxx.ear:main" from Service Module Loader]

      Now what i don't understand is why is it trying to load  org.springframework.web.context.ContextLoaderListener from "deployment.xxxxxx.ear:main"  instead of "deployment.xxxxxx.ear.yyyyyy.war:main"


      Here is how my xxxx.ear looks







      to confirm the behavior i moved all the jars from yyyyy.war/lib folder to a lib folder in ear (created one)

      yyyy.war/lib ---> xxxx.ear/lib

      and it worked fine.

      Why is service tying to load  ContextLoaderListener ear:main even though all the implementation is in war.

        • 1. Re: Jboss EAP 6.3 ear fails but war works.
          Jay SenSharma Master

          Can you check if by any chance are you placing any  "yyyy.war/WEB-INF/jboss-deployment-structure.xml" inside your WAR? 

          In case of EAR that file is expected to be placed inside the xxxx.ear/META-INF else it is ignored.

          • 2. Re: Jboss EAP 6.3 ear fails but war works.
            Sandeep Kumar Newbie

            I did try that, but same result. Is there a way to give dependencies from WAR to EAR in deployment structure?

            This is how it looks when moved to EAR

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


               <sub-deployment name="yyyyyyy.war">


                        <module name="com.oracle.ojdbc6-EJ" services="export" />





            But error is coming when it starts deploying the war inside the ear and looking for spring ContextLoaderListener.