以前迁移到 JBoss 7.1 并且运行良好的 Seam 战争应用程序 (jsf 1.2),现在需要迁移到 Wildfly beta1。
Wildfly 默认不支持 jsf 1.2,因此按照以下说明启用它:
https://community.jboss.org/wiki/DesignOfWildFlyMulti-JSFFeature
该项目构建良好,wildfly 启动也很好。当我尝试打开一个页面时,它抛出了异常:
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]
11:13:43,578 ERROR [org.jboss.as.txn] (default task-1) JBAS010152: APPLICATION ERROR: transaction still active in request with status 0
根据此链接,javax.faces.context.FacesContext.getAttributes() 的返回类型参数发生了变化:
https://java.net/jira/browse/JAVASERVERFACES-1847
似乎两个 jsf 版本都已启用:
INFO [org.jboss.as.jsf] (ServerService Thread Pool -- 39) JBAS012605: Activated the following JSF Implementations: [mojarra-1.2_15, main]
怎么能解决?