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

    Jboss EAP 6.3 ear fails but war works.

    sandeepkumar08

      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

      xxxx.ear

           --META-INF

                --application.xml

                --MANIFEST.MF

           --yyyyyy.war

       

      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.
          jaysensharma

          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.
            sandeepkumar08

            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"?>

            <jboss-deployment-structure>

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

                    <dependencies>

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

                    </dependencies>

              </sub-deployment>

              </jboss-deployment-structure>

             

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