2 Replies Latest reply on Nov 7, 2013 6:45 PM by Tomaz Cerar

    Migrating jsf 1.2 Seam app from JBoss 7.1 to Wildfly beta1

    H G Newbie

      Hi,

       

      I have a WAR app with Seam, jsf 1.2 running on jboss 7.1 an we want to migrate to Wildfly beta 1. I activated jsf 1.2 following this article Design of WildFly Multi-JSF feature.

      The project builds fine and wildfly also starts fine. When I try to open a page it's thrown the next exception:

       

      11:13:43,546 ERROR [io.undertow.request] (default task-1) Servlet request failed HttpServerExchange{ GET /webapp/page.seam}: java.lang.NoSuchMethodError: javax.faces.context.FacesContext.getAttributes()Ljava/util/Map;
      at org
      .jboss.weld.jsf.ConversationAwareViewHandler.getActionURL(ConversationAwareViewHandler.java:103) [weld-core-jsf-2.1.0.CR1.jar:2013-09-26 16:53]
      at javax
      .faces.application.ViewHandlerWrapper.getActionURL(ViewHandlerWrapper.java:147) [jsf-api-1.2_15.jar:1.2_15-20100816-SNAPSHOT]
      at com
      .sun.facelets.FaceletViewHandler.getActionURL(FaceletViewHandler.java:803) [jsf-facelets.jar:1.1.15.B1]
      at org
      .ajax4jsf.application.ViewHandlerWrapper.getActionURL(ViewHandlerWrapper.java:86) [richfaces-api-3.3.3.Final.jar:3.3.3.Final]
      at org
      .jboss.seam.faces.FacesManager.redirect(FacesManager.java:168) [jboss-seam.jar:2.2.2.Final]
      at org
      .jboss.seam.faces.FacesManager.redirect(FacesManager.java:143) [jboss-seam.jar:2.2.2.Final]
      at org
      .jboss.seam.navigation.Pages.redirectToLoginView(Pages.java:563) [jboss-seam.jar:2.2.2.Final]
      at org
      .jboss.seam.navigation.Pages.postRestore(Pages.java:414) [jboss-seam.jar:2.2.2.Final]
      at org
      .jboss.seam.jsf.SeamPhaseListener.postRestorePage(SeamPhaseListener.java:544) [jboss-seam.jar:2.2.2.Final]
      at org
      .jboss.seam.jsf.SeamPhaseListener.afterRestoreView(SeamPhaseListener.java:393) [jboss-seam.jar:2.2.2.Final]
      at org
      .jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:229) [jboss-seam.jar:2.2.2.Final]
      at org
      .jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:195) [jboss-seam.jar:2.2.2.Final]
      at com
      .sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:175) [jsf-impl-1.2_15.jar:1.2_15-20100816-SNAPSHOT]
      at com
      .sun.faces.lifecycle.Phase.doPhase(Phase.java:114) [jsf-impl-1.2_15.jar:1.2_15-20100816-SNAPSHOT]
      at com
      .sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:102) [jsf-impl-1.2_15.jar:1.2_15-20100816-SNAPSHOT]
      at com
      .sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) [jsf-impl-1.2_15.jar:1.2_15-20100816-SNAPSHOT]
      at javax
      .faces.webapp.FacesServlet.service(FacesServlet.java:265) [jsf-api-1.2_15.jar:1.2_15-20100816-SNAPSHOT]
      at io
      .undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:87) [undertow-servlet-1.0.0.Beta17.jar:1.0.0.Beta17]
      at io
      .undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:130) [undertow-servlet-1.0.0.Beta17.jar:1.0.0.Beta17]
      at org
      .jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83) [jboss-seam.jar:2.2.2.Final]
      at org
      .jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40) [jboss-seam.jar:2.2.2.Final]
      at org
      .jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:2.2.2.Final]
      at org
      .jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90) [jboss-seam.jar:2.2.2.Final]
      at org
      .jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:2.2.2.Final]
      at org
      .jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64) [jboss-seam.jar:2.2.2.Final]
      at org
      .jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:2.2.2.Final]
      at org
      .jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45) [jboss-seam.jar:2.2.2.Final]
      at org
      .jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:2.2.2.Final]
      at org
      .jboss.seam.web.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:42) [jboss-seam.jar:2.2.2.Final]
      at org
      .jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:2.2.2.Final]
      at org
      .ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206) [richfaces-impl-3.3.3.Final.jar:3.3.3.Final]
      at org
      .ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290) [richfaces-impl-3.3.3.Final.jar:3.3.3.Final]
      at org
      .ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388) [richfaces-impl-3.3.3.Final.jar:3.3.3.Final]
      at org
      .ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515) [richfaces-impl-3.3.3.Final.jar:3.3.3.Final]
      at org
      .jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56) [jboss-seam.jar:2.2.2.Final]
      at org
      .jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:2.2.2.Final]
      at org
      .jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60) [jboss-seam.jar:2.2.2.Final]
      at org
      .jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:2.2.2.Final]
      at org
      .jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158) [jboss-seam.jar:2.2.2.Final]
      at io
      .undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:56) [undertow-servlet-1.0.0.Beta17.jar:1.0.0.Beta17]
      at io
      .undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.0.0.Beta17.jar:1.0.0.Beta17]
      at io
      .undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:85) [undertow-servlet-1.0.0.Beta17.jar:1.0.0.Beta17]
      at io
      .undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:93) [undertow-servlet-1.0.0.Beta17.jar:1.0.0.Beta17]
      at io
      .undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.0.0.Beta17.jar:1.0.0.Beta17]
      at org
      .wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:81)
      at io
      .undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Beta17.jar:1.0.0.Beta17]
      at io
      .undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113) [undertow-servlet-1.0.0.Beta17.jar:1.0.0.Beta17]
      at io
      .undertow.security.handlers.AuthenticationCallHandler.handleRequest(AuthenticationCallHandler.java:52) [undertow-core-1.0.0.Beta17.jar:1.0.0.Beta17]
      at io
      .undertow.security.handlers.AuthenticationConstraintHandler.handleRequest(AuthenticationConstraintHandler.java:51) [undertow-core-1.0.0.Beta17.jar:1.0.0.Beta17]
      at io
      .undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45) [undertow-core-1.0.0.Beta17.jar:1.0.0.Beta17]
      at io
      .undertow.servlet.handlers.security.ServletSecurityConstraintHandler.handleRequest(ServletSecurityConstraintHandler.java:55) [undertow-servlet-1.0.0.Beta17.jar:1.0.0.Beta17]
      at io
      .undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:65) [undertow-servlet-1.0.0.Beta17.jar:1.0.0.Beta17]
      at io
      .undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:70) [undertow-core-1.0.0.Beta17.jar:1.0.0.Beta17]
      at io
      .undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Beta17.jar:1.0.0.Beta17]
      at io
      .undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Beta17.jar:1.0.0.Beta17]
      at io
      .undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:218) [undertow-servlet-1.0.0.Beta17.jar:1.0.0.Beta17]
      at io
      .undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:205) [undertow-servlet-1.0.0.Beta17.jar:1.0.0.Beta17]
      at io
      .undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:69) [undertow-servlet-1.0.0.Beta17.jar:1.0.0.Beta17]
      at io
      .undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:134) [undertow-servlet-1.0.0.Beta17.jar:1.0.0.Beta17]
      at io
      .undertow.server.HttpHandlers.executeRootHandler(HttpHandlers.java:36) [undertow-core-1.0.0.Beta17.jar:1.0.0.Beta17]
      at io
      .undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:619) [undertow-core-1.0.0.Beta17.jar:1.0.0.Beta17]
      at java
      .util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_25]
      at java
      .util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_25]
      at java
      .lang.Thread.run(Unknown Source) [rt.jar:1.7.0_25]

       

       

       

      In jsf 1.2 doesn't exists javax.faces.context.FacesContext.getAttributes(). weld-core-jsf-2.1.0.CR1.jar hasn't backward compatibility and call this method:


                if (facesContext.getAttributes().containsKey(Container.CONTEXT_ID_KEY))


      So I will need to activate another slot module for previous weld version that is compatible with jsf (the weld module in jboss 7.1 hast to work). Which is the latest weld version compatible with jsf 1.2?

       

      What is the proper way to add the weld module?

        • 1. Re: Migrating jsf 1.2 Seam app from JBoss 7.1 to Wildfly beta1
          H G Newbie

          I'm trying to add another weld module.

           

          I cretated the folders:

          modules\org\jboss\weld\api\weld-api-1.1.Final

          modules\org\jboss\weld\core\weld-core-1.1.5.AS71.Final

          modules\org\jboss\weld\spi\weld-spi-1.1.Final



          weld-api-1.1.Final - module.xml

          <module xmlns="urn:jboss:module:1.1" name="org.jboss.weld.api" slot="weld-api-1.1.Final">

           

              <resources>

                  <resource-root path="weld-api-1.1.Final.jar"/>

                  <!-- Insert resources here -->

              </resources>

           

              <dependencies>

                  <module name="javax.api"/>

                  <module name="javax.enterprise.api"/>

                  <module name="javax.inject.api"/>

                  <module name="javax.persistence.api"/>

                  <module name="javax.interceptor.api"/>

                  <module name="javax.servlet.api"/>

              </dependencies>

          </module>

           

           

          weld-core-1.1.5.AS71.Final - module.xml

          <module xmlns="urn:jboss:module:1.1" name="org.jboss.weld.core" slot="weld-core-1.1.5.AS71.Final">

           

              <properties>

                  <property name="jboss.api" value="private"/>

              </properties>

           

              <resources>

                  <resource-root path="weld-core-1.1.5.AS71.Final.jar"/>

                  <!-- Insert resources here -->

              </resources>

           

              <dependencies>

                  <module name="ch.qos.cal10n" />

                  <module name="com.google.guava"/>

                  <module name="javax.api"/>

                  <module name="javax.annotation.api"/>

                  <module name="javax.el.api" />

                  <module name="javax.enterprise.api"/>

                  <module name="javax.faces.api"/>

                  <module name="javax.inject.api"/>

                  <module name="javax.interceptor.api"/>

                  <module name="javax.persistence.api"/>

                  <module name="javax.servlet.api"/>

                  <module name="javax.transaction.api"/>

                  <module name="javax.validation.api"/>

                  <module name="org.javassist"/>

                  <module name="org.jboss.interceptor"/>

                  <module name="org.jboss.interceptor.spi"/>

                  <module name="org.jboss.weld.api" slot="weld-api-1.1.Final" />

                  <module name="org.jboss.weld.spi" slot="weld-spi-1.1.Final"/>

                  <module name="org.slf4j" />

                  <module name="org.slf4j.ext" />

              </dependencies>

          </module>

           

           

          weld-spi-1.1.Final - module.xml

          <module xmlns="urn:jboss:module:1.1" name="org.jboss.weld.spi" slot="weld-spi-1.1.Final">

           

              <properties>

                  <property name="jboss.api" value="private"/>

              </properties>

           

              <resources>

                  <resource-root path="weld-spi-1.1.Final.jar"/>

                  <!-- Insert resources here -->

              </resources>

           

              <dependencies>

                  <module name="javax.annotation.api"/>

                  <module name="javax.api"/>

                  <module name="javax.enterprise.api"/>

                  <module name="javax.inject.api"/>

                  <module name="javax.persistence.api"/>

                  <module name="javax.servlet.api"/>

                  <module name="javax.validation.api"/>

                  <module name="org.jboss.weld.api" slot="weld-api-1.1.Final"/>

              </dependencies>

          </module>

           

          The resources jars were copied from jboss 7.1

           

          This is the jboss-deployment-structure.xml

           

          <jboss-deployment-structure>

             <deployment>

                  <exclusions>

                    <module name="org.jboss.weld.api" slot="main"/>

                    <module name="org.jboss.weld.core" slot="main"/>

                    <module name="org.jboss.weld.spi" slot="main"/>

                  </exclusions>

                  <dependencies>

                   <module name="org.jboss.weld.api" slot="weld-api-1.1.Final"/>

                   <module name="org.jboss.weld.core" slot="weld-core-1.1.5.AS71.Final"/>

                   <module name="org.jboss.weld.spi" slot="weld-spi-1.1.Final"/>

                  </dependencies>

              </deployment> 

          </jboss-deployment-structure>

           

           

           

          I don't know if I'm adding correctly the module? The next exception is thrown:

           

          17:35:47,375 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.deployment.unit."mo_1_7_4.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."app.war".WeldStartService: Failed to start service

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1900) [jboss-msc-1.2.0.Beta2.jar:1.2.0.Beta2]

              at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_25]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_25]

              at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_25]

          Caused by: org.jboss.weld.exceptions.WeldException: WELD-001524: Unable to load proxy class for bean Built-in Bean [javax.transaction.UserTransaction] with qualifiers [@Default] with class interface javax.transaction.UserTransaction using classloader ModuleClassLoader for Module "deployment.app.war:main" from Service Module Loader

              at org.jboss.weld.bean.proxy.ProxyFactory.getProxyClass(ProxyFactory.java:315)

              at org.jboss.weld.bean.proxy.ProxyFactory.create(ProxyFactory.java:266)

              at org.jboss.weld.bean.builtin.ee.AbstractEEBean.<init>(AbstractEEBean.java:36)

              at org.jboss.weld.bean.builtin.ee.UserTransactionBean.<init>(UserTransactionBean.java:50)

              at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:249)

              at org.jboss.weld.bootstrap.WeldStartup.deployBeans(WeldStartup.java:381)

              at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:76)

              at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:64)

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1944) [jboss-msc-1.2.0.Beta2.jar:1.2.0.Beta2]

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1877) [jboss-msc-1.2.0.Beta2.jar:1.2.0.Beta2]

              ... 3 more

          Caused by: java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/jboss/weld/interceptor/proxy/LifecycleMixin

              at org.jboss.weld.util.bytecode.ClassFileUtils.toClass(ClassFileUtils.java:101)

              at org.jboss.weld.bean.proxy.ProxyFactory.createProxyClass(ProxyFactory.java:423)

              at org.jboss.weld.bean.proxy.ProxyFactory.getProxyClass(ProxyFactory.java:308)

              ... 12 more

          Caused by: java.lang.NoClassDefFoundError: org/jboss/weld/interceptor/proxy/LifecycleMixin

              at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0_25]

              at java.lang.ClassLoader.defineClass(Unknown Source) [rt.jar:1.7.0_25]

              at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source) [:1.7.0_25]

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.7.0_25]

              at java.lang.reflect.Method.invoke(Unknown Source) [rt.jar:1.7.0_25]

              at org.jboss.weld.util.bytecode.ClassFileUtils.toClass2(ClassFileUtils.java:108)

              at org.jboss.weld.util.bytecode.ClassFileUtils.toClass(ClassFileUtils.java:97)

              ... 14 more

          Caused by: java.lang.ClassNotFoundException: org.jboss.weld.interceptor.proxy.LifecycleMixin from [Module "deployment.app.war:main" from Service Module Loader]

              at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:197) [jboss-modules.jar:1.3.0.Final]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:443) [jboss-modules.jar:1.3.0.Final]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:431) [jboss-modules.jar:1.3.0.Final]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:373) [jboss-modules.jar:1.3.0.Final]

              at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:118) [jboss-modules.jar:1.3.0.Final]

              ... 21 more

          • 2. Re: Migrating jsf 1.2 Seam app from JBoss 7.1 to Wildfly beta1
            Tomaz Cerar Master

            hi,

             

            try excluding weld subsystem in jboss-deployment-structure.xml.

             

            see on how: https://docs.jboss.org/author/display/WFLY8/Class+Loading+in+WildFly

             

            you don't need different version of weld or anything like it, as seam 2 does not need CDI to work.

             

             

            --

            tomaz