1 Reply Latest reply on Feb 17, 2009 6:56 PM by Roger Silva

    Seam 2.1.1.GA issues JBoss 5

    Roger Silva Newbie

      Hi all, how are you?
      I'm trying to create a new EAR application using Seam 2.1.1.GA from scratch to be deployed on JBoss 5.


      This project uses maven as build tool, and as I wanted to use JBoss Seam thus the following dependencies were included on the project web module:



            <dependency>
                <groupId>org.jboss.seam</groupId>
                <artifactId>jboss-seam-ui</artifactId>
                <version>2.1.1.GA</version>
           </dependency>
                
           <dependency>
                <groupId>org.jboss.seam</groupId>
                <artifactId>jboss-seam-debug</artifactId>
                <version>2.1.1.GA</version>
           </dependency>           
           <dependency>
               <groupId>org.jboss.seam</groupId>
                <artifactId>jboss-seam</artifactId>
                <version>2.1.1.GA</version>
              </dependency>   
      



      When I tried to deploy this project with those library dependencies then JBoss throws the following errors in ($JBOSSHOME$/server/default/log/server.log):

      2009-02-17 13:56:10,921 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/store]] (HDScanner) Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
      java.lang.IllegalStateException: duplicate factory for: org.jboss.seam.web.webSession (duplicate is specified in components.xml)
           at org.jboss.seam.core.Init.checkDuplicateFactoryExpressions(Init.java:227)
           at org.jboss.seam.core.Init.checkDuplicateFactory(Init.java:220)
           at org.jboss.seam.core.Init.addFactoryValueExpression(Init.java:283)
           at org.jboss.seam.init.Initialization.installComponents(Initialization.java:1128)
           at org.jboss.seam.init.Initialization.init(Initialization.java:728)
           at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:35)
           at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3910)
           at org.apache.catalina.core.StandardContext.start(StandardContext.java:4393)
           at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:367)
           at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:146)
           at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:460)
           at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
           at org.jboss.web.deployers.WebModule.start(WebModule.java:96)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
           at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
           at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
           at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
           at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
           at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
           at $Proxy36.start(Unknown Source)
           at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
           at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
           at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
           at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
           at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
           at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
           at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:286)
           at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
           at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
           at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
           at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
           at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
           at org.jboss.system.ServiceController.start(ServiceController.java:460)
           at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:146)
           at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:104)
           at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:45)
           at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
           at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
           at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
           at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
           at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
           at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
           at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
           at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
           at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
           at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
           at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
           at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
           at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
           at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
           at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
           at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:290)
           at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
           at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
           at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
           at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
           at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
           at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
           at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
           at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
           at java.lang.Thread.run(Thread.java:619)

        • 1. Re: Seam 2.1.1.GA issues JBoss 5
          Roger Silva Newbie
          Sorry...I mistakenly saved the message before providing the full information...

          So, If dependency for library jboss-seam-jbas5 is included on the project:

          `
                   <dependency>
                                  <groupId>org.jboss.seam</groupId>
                                  <artifactId>jboss-seam-jbas5</artifactId>
                                  <version>2.1.0.A1</version>
                          <scope>compile</scope>
                          </dependency>
          `

          Therefore, JBoss AS throws the following errors:

          2009-02-17 13:59:52,250 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/store]] (HDScanner) Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
          java.lang.NoSuchMethodError: org.jboss.seam.deployment.DeploymentStrategy.handle(Ljava/lang/String;)V
                  at org.jboss.seam.as5.vfs.VFSScanner.handleRoot(VFSScanner.java:186)
                  at org.jboss.seam.as5.vfs.VFSScanner.scanResources(VFSScanner.java:148)
                  at org.jboss.seam.deployment.StandardDeploymentStrategy.scan(StandardDeploymentStrategy.java:113)
                  at org.jboss.seam.init.Initialization.create(Initialization.java:132)
                  at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:35)
                  at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3910)
                  at org.apache.catalina.core.StandardContext.start(StandardContext.java:4393)
                  at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:367)
                  at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:146)
                  at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:460)
                  at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
                  at org.jboss.web.deployers.WebModule.start(WebModule.java:96)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:597)
                  at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
                  at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
                  at $Proxy36.start(Unknown Source)
                  at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
                  at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
                  at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
                  at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
                  at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
                  at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
                  at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:286)
                  at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
                  at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
                  at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
                  at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
                  at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
                  at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
                  at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
                  at org.jboss.system.ServiceController.start(ServiceController.java:460)
                  at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:146)
                  at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:104)
                  at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:45)
                  at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
                  at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
                  at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
                  at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
                  at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
                  at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
                  at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
                  at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
                  at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
                  at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
                  at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
                  at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
                  at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
                  at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
                  at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
                  at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
                  at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
                  at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:290)
                  at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
                  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
                  at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
                  at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
                  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
                  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
                  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
                  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
                  at java.lang.Thread.run(Thread.java:619)

          Here are the details of my development environment:
          Environment:
          JBoss AS 5.0.0.GA (for jdk 6)
          OS: Windows XP Sp3
          JDK: Java Sun SDK 1.6 update 12 ( build 1.6.0_12-b04 )

          Please, Does somebody know what is causing this issues?and why?Should I really use jboss-seam-jbas5 library?Did I miss any deployment file configuration?

          Here is the app web.xml file:
          `<?xml version="1.0" encoding="UTF-8"?>
          <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xmlns="http://java.sun.com/xml/ns/javaee"
                  xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
                  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
                  id="WebApp_ID" version="2.5">
                  <display-name>Store</display-name>
                  <welcome-file-list>
                          <welcome-file>index.jsp</welcome-file>
                  </welcome-file-list>

              <!-- Seam Begin -->
             <filter>
                <filter-name>Seam Filter</filter-name>
                <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
             </filter>

             <filter-mapping>
                <filter-name>Seam Filter</filter-name>
                <url-pattern>/*</url-pattern>
             </filter-mapping>  
             <listener>
                <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
             </listener>

             <servlet>
                <servlet-name>Seam Resource Servlet</servlet-name>
                <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
             </servlet>

             <servlet-mapping>
                <servlet-name>Seam Resource Servlet</servlet-name>
                <url-pattern>/seam/resource/*</url-pattern>
             </servlet-mapping>
                  <!-- Seam End -->

                  <!-- Use Documents Saved as *.xhtml -->
                  <context-param>
                          <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
                          <param-value>.xhtml</param-value>
                  </context-param>

                  <!-- Special Debug Output for Development -->
                  <context-param>
                          <param-name>facelets.DEVELOPMENT</param-name>
                          <param-value>false</param-value>
                  </context-param>
                 
                  <!-- Optional JSF-RI Parameters to Help Debug -->
                  <context-param>
                          <param-name>com.sun.faces.validateXml</param-name>
                          <param-value>true</param-value>
                  </context-param>
                  <context-param>
                          <param-name>com.sun.faces.verifyObjects</param-name>
                          <param-value>true</param-value>
                  </context-param>

                  <context-param>
                          <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
                          <param-value>server</param-value>
                  </context-param>

                  <context-param>
                          <param-name>facelets.SKIP_COMMENTS</param-name>
                          <param-value>true</param-value>
                  </context-param>
                 
                  <context-param>
                          <param-name>facelets.REFRESH_PERIOD</param-name>
                          <param-value>-1</param-value>
                  </context-param>

                  <!-- Richfaces Filter -->
                  <filter>
                          <display-name>RichFaces Filter</display-name>
                          <filter-name>richfaces</filter-name>
                          <filter-class>org.ajax4jsf.Filter</filter-class>
                          <init-param>
                          <param-name>createTempFiles</param-name>
                      <param-value>true</param-value>
                          </init-param>
                          <init-param>
                          <param-name>maxRequestSize</param-name>
                          <param-value>500000000</param-value>
                          </init-param>            
                  </filter>
                  <filter-mapping>
                          <filter-name>richfaces</filter-name>
                          <servlet-name>Faces Servlet</servlet-name>
                          <dispatcher>REQUEST</dispatcher>
                          <dispatcher>FORWARD</dispatcher>
                          <dispatcher>INCLUDE</dispatcher>
                  </filter-mapping>

                  <!-- Rich Faces config -->
                  <context-param>
                          <param-name>org.richfaces.SKIN</param-name>
                          <param-value>emeraldTown</param-value>
                  </context-param>

                  <servlet>
                          <servlet-name>Faces Servlet</servlet-name>
                          <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                          <load-on-startup>1</load-on-startup>
                  </servlet>

                  <servlet-mapping>
                          <servlet-name>Faces Servlet</servlet-name>
                          <url-pattern>*.jsf</url-pattern>
                  </servlet-mapping>
                  <!-- SEAM -->
                  <context-param>
                  <param-name>javax.faces.CONFIG_FILES</param-name>
                  <param-value>/WEB-INF/faces-config.xml</param-value>
                  </context-param>
             
                  <error-page>
                          <exception-type>java.lang.Exception</exception-type>
                          <location>/errorPage.jsp</location>
                  </error-page>

          </web-app>`

          And here goes the app faces-config.xml file:
          `<?xml version="1.0" encoding="UTF-8"?>

          <!DOCTYPE faces-config PUBLIC
              "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
              "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">

          <faces-config>
                  <!-- SEAM -->
                  <lifecycle>
                  <phase-listener>
                  org.jboss.seam.jsf.SeamPhaseListener
                  </phase-listener>
                  </lifecycle>
                  <!-- Global Configurations -->
                  <application>

                          <!-- Integration with facelets -->
                          <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>

                          <!--  Resource Bundle for labels -->
                          <locale-config>
                                  <default-locale>en</default-locale>
                                  <supported-locale>en</supported-locale>
                          </locale-config>
                          <message-bundle>
                                  com.mycompany.store.bundle.Labels
                          </message-bundle>

                  </application>

          </faces-config>`


          Thanks in advance,
          Roger