4 Replies Latest reply on Mar 13, 2013 5:27 AM by webut

    Deployment of EAR and separate WAR making trouble

    webut

      Hi everybody,

       

      I am starting to work on a migration of an older (legacy) application. There is a web application and a lot of business logic spread over many servlets.

       

      Now I want to start with an encapsulated component which was accessed by RMI. The idea is to deploy it as an .ear file and deploy the .war separately, because this .ear will take quite a long time to start (5-10 min...), making it very unhandy for development (and not much change is needed by now). Also the web app will have to access different external components later.

       

      The .ear now contains an EJB (Singleton), I have created local and remote interfaces.

       

      The thing actually works when I deploy as a whole (.war withing .ear) but makes some problems when I try to separate it.

       

      The EJB interfaces are located in a Utility project, which is deployed twice within the .ear and .war. It deploys with no errors but when the web app (JSF) tries to inject the ejb, it will fail with this error:

       

      Caused by: java.lang.IllegalArgumentException: Can not set de.test.service.DataserviceLocal field de.hvb.rep.web.RepMain.dataservice to de.test.service.DataserviceLocal$$$view3

       

      I suspect that jboss won't like the interfaces deployed two times, so I tried to deploy them as separate .jar. But then I will get a NoClassDefFound... exception.

       

      How can an outside .jar be accessed from an .ear or .war?

       

      By now I reference all the inside .jar's via the MANIFEST.MF.

       

      Thank you

      Werner

        • 1. Re: Deployment of EAR and separate WAR making trouble
          tviet

          Hi Werner,

           

          I faced with the same thing as you mentioned above. Have you found any solution please advice?

           

          Thanks,

          Viet Tran

          • 2. Re: Deployment of EAR and separate WAR making trouble
            prashamsjain

            Hi,

             

            Even I am facing similar issues. and it is throwing this exception. Unable to file the reason as this is the complete stack-trace for this errors

             

            06:47:11,620 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-2) Error listenerStart
            06:47:11,620 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-2) Context [/applicationName] startup failed due to previous errors
            06:47:11,636 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2)
            MSC000001: Failed to start service jboss.web.deployment.default-host./applicationName:
            org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./applicationName:
            JBAS018040: Failed to start context

            • 3. Re: Deployment of EAR and separate WAR making trouble
              mp911de

              Hi,

              please keep in mind, if you want to access EJB's from a WAR which is outside your EAR, you must use Remote EJB (classloading and serialization is handled differently in comparison to Local EJB). You've got also to package the API part of the EJB (the interfaces, exceptions and model classes) as some sort of API artifact into your WAR (but without the EJB impl).

               

              Best regards, Mark

              • 4. Re: Deployment of EAR and separate WAR making trouble
                webut

                Hi,

                unfortunately I didn't find a solution back then. Until now I am working with a regular EAR. Lucky me, the data volume in the application is much less then expected, so it is not a crucial issue for me anymore.

                Though the issue will come back in the future...

                 

                @Mark: I did in fact deploy the interfaces/dtos in a utility jar but that didn't work out either. Unfortunately I cannot provide you with any detailed information anymore.

                 

                regards
                Werner