5 Replies Latest reply on Sep 29, 2011 12:09 PM by newbee07

    Issue with Two Wars in one EAR

    newbee07

      I am seeing a issue with two wars and ejb-seam component in my ear (profile.ear).

       

      I dit not see the issue with just one war profile.war, the below issue started when i deployed another war vendor.war into my ear.

       

      "globalLoad" is a application scoped start-up seam component.

       

      I am using seam 2.2.0 GA with jboss 5.1.0.GA. Below is the issue.

       

      Timely help is really appreciated.

       

       

      WARN  [SeamPhaseListener] There should only be one Seam phase listener per application

       

      23:50:41,703 ERROR [[/vendor]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener

      org.jboss.seam.InstantiationException: Could not instantiate Seam component: globalLoad

              at org.jboss.seam.Component.newInstance(Component.java:2144)

              at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304)

              at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278)

              at org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:116)

              at org.jboss.seam.init.Initialization.init(Initialization.java:740)

              at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:36)

              at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3910)

                --------

              at java.lang.Thread.run(Thread.java:619)

      Caused by: javax.naming.NameNotFoundException: vendor not bound

              at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)

              at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)

              at org.jnp.server.NamingServer.getObject(NamingServer.java:785)

              at org.jnp.server.NamingServer.lookup(NamingServer.java:396)

              at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)

              at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)

              at javax.naming.InitialContext.lookup(InitialContext.java:392)

              at org.jboss.seam.Component.instantiateSessionBean(Component.java:1400)

       

      23:50:42,265 ERROR [AbstractKernelController] Error installing to Real: name=vfszip:/C:/jboss-5.1.0.GA/server/default/deploy/profile.ear/ state=PreReal mode=Manual requiredState=Real

      org.jboss.deployers.spi.DeploymentException: URL file:/C:/jboss-5.1.0.GA/server/default/tmp/5c4o12-1owf12-glhhm7d3-1-glhhnlus-a0/vendor.war/ deployment failed

              at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:331)

              at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142)

              at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)

              at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)

        • 1. Issue with Two Wars in one EAR
          newbee07

          Any help would be appreciated. If needed I can provide further info.

          • 2. Issue with Two Wars in one EAR
            mp911de

            Hi,

            the problem is that seam loads anything named globalLoad per WAR-File. Due the fact, that one ear shares it's classloader and seam allows only one initialization it crashes. Setup isolated Class-Loading (http://community.jboss.org/wiki/classloadingconfiguration).

            Best regards,

            Mark

            • 3. Re: Issue with Two Wars in one EAR
              newbee07

              I have followed the link on isolation and kind of implemented what it suggested butstill my start-up component is called twice. And I see the below warning.

               

              WARN  [SeamPhaseListener] There should only be one Seam phase listener per application

               

              this is what I have. All my seam components are there in ejbSeam.jar.

               

              seam.ear --- META-INF/jboss-app.xml

               

              <jboss-app>

                    <loader-repository>

                    seam.jboss.org:loader=profile

                    <loader-repository-config>

                       java2ParentDelegation=false

                    </loader-repository-config>

                    </loader-repository>

              </jboss-app>

               

              ejbSeam.jar ---- META-INF/jboss.xml

               

              <jboss>

                <loader-repository>

                 profile:loader=ProfileEjB

                </loader-repository>

              </jboss>

               

              war1.war --- WEB-INF/jboss-web.xml

               

              <jboss-web>

                 <class-loading java2ClassLoadingCompliance="false">

                    <loader-repository>

                       com.efood:archive=profile-war

                       <loader-repository-config>java2ParentDelegation=false</loader-repository-config>

                    </loader-repository>

                 </class-loading>

              </jboss-web>

               

              war2.war --- WEB-INF/jboss-web.xml

               

              <jboss-web>

                 <class-loading java2ClassLoadingCompliance="false">

                    <loader-repository>

                       com.efood:loader=vendor

                       <loader-repository-config>java2ParentDelegation=false</loader-repository-config>

                    </loader-repository>

                 </class-loading>

              </jboss-web>

               

              Please let me know if I am missing anything.

              • 4. Issue with Two Wars in one EAR
                apostolos.pantazis

                which version of seam are you running? I agree with Mark this is a classloader isolation issue.

                 

                How many instances of jboss-seam.jar exist in server_conf -> tmp?  also in deploy have (1) instance of jboss-seam.jar correct?

                 

                Let me know

                • 5. Re: Issue with Two Wars in one EAR
                  newbee07

                  Hey Paul,

                   

                  Sorry for the late resopnse,

                   

                  Asnwering your question, there is no other instance of jboss-seam.jar. We have this jboss-seam.jar only on the ear directly.I checkes the tmp folder I did not see there either.

                   

                  We are using seam 2.2.0.GA.

                   

                  Hope you will respond to this asap unlike me.