JSF 2.2中的Seam导致com.sun.faces.application.NavigationHandlerImpl.determineViewFromActionOutcome中的java.lang.NullPointerException

时间:2015-07-15 10:00:08

标签: jsf seam jsf-2.2 wildfly-8

我正在尝试在WildFly8.2上运行我的应用程序,它是使用Jboss 5.1构建的。我迁移了我的整个应用程序并能够看到登录页面。但是在导航到JSF页面时,它会抛出以下异常。

我的旧应用程序基于JSF 1.2构建

2015-07-15 14:49:02,108 INFO          [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-1)     Initializing Mojarra 2.2.8-jbossorg-1 20140822-1131 for context '/booking'
    2015-07-15 14:49:03,303 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) JBAS017534: Registered web context: /booking
2015-07-15 14:49:03,402 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 28) JBAS018559: Deployed "booking.ear" (runtime-name : "booking.ear")
2015-07-15 14:49:03,508 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:10190/management
2015-07-15 14:49:03,514 INFO  [org.jboss.as] (Controller Boot Thread)     JBAS015951: Admin console listening on http://127.0.0.1:10190
2015-07-15 14:49:03,519 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: WildFly 8.2.0.Final "Tweek" started in 15104ms - Started 637 of 711 services (124 services are lazy, passive or on-demand)
2015-07-15 14:50:12,989 INFO  [org.jboss.seam.servlet.SeamFilter] (default task-1) Initializing filter: org.jboss.seam.web.redirectFilter
2015-07-15 14:50:12,993 INFO  [org.jboss.seam.servlet.SeamFilter] (default task-1) Initializing filter: org.jboss.seam.web.exceptionFilter
2015-07-15 14:50:12,995 INFO  [org.jboss.seam.servlet.SeamFilter] (default task-1) Initializing filter: org.jboss.seam.web.multipartFilter
2015-07-15 14:50:12,996 INFO  [org.jboss.seam.servlet.SeamFilter] (default task-1) Initializing filter: org.jboss.seam.web.loggingFilter
2015-07-15 14:50:12,998 INFO  [org.jboss.seam.servlet.SeamFilter] (default task-1) Initializing filter: org.jboss.seam.web.identityFilter
2015-07-15 14:50:20,699 ERROR [org.jboss.seam.exception.Exceptions] (default task-13) handled and logged exception: javax.servlet.ServletException
  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:659) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
  at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
  at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:130) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83) [jboss-seam.jar:2.3.1.Final]
  at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40) [jboss-seam.jar:2.3.1.Final]
  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:2.3.1.Final]
  at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60) [jboss-seam.jar:2.3.1.Final]
  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:2.3.1.Final]
  at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90) [jboss-seam.jar:2.3.1.Final]
  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:2.3.1.Final]
  at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64) [jboss-seam.jar:2.3.1.Final]
  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:2.3.1.Final]
  at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45) [jboss-seam.jar:2.3.1.Final]
  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:2.3.1.Final]
  at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158) [jboss-seam.jar:2.3.1.Final]
  at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
  at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
  at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:85) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
  at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
  at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
  at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
  at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
  at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
  at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
  at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:63) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
  at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
  at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
  at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
  at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
  at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:261) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
  at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:247) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
  at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:76) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
  at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:166) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
  at io.undertow.server.Connectors.executeRootHandler(Connectors.java:197) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
  at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:759) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_11]
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_11]
  at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_11]
Caused by: java.lang.NullPointerException
  at com.sun.faces.application.NavigationHandlerImpl.determineViewFromActionOutcome(NavigationHandlerImpl.java:1341) [jsf-impl-2.2.8-jbossorg-1.jar:]
  at com.sun.faces.application.NavigationHandlerImpl.findWildCardMatch(NavigationHandlerImpl.java:661) [jsf-impl-2.2.8-jbossorg-1.jar:]
  at com.sun.faces.application.NavigationHandlerImpl.getViewId(NavigationHandlerImpl.java:483) [jsf-impl-2.2.8-jbossorg-1.jar:]
  at com.sun.faces.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:190) [jsf-impl-2.2.8-jbossorg-1.jar:]
  at com.sun.faces.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:183) [jsf-impl-2.2.8-jbossorg-1.jar:]
  at org.jboss.seam.jsf.SeamNavigationHandler.handleNavigation(SeamNavigationHandler.java:49) [jboss-seam.jar:2.3.1.Final]
  at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:132) [jsf-impl-2.2.8-jbossorg-1.jar:]
  at javax.faces.component.UICommand.broadcast(UICommand.java:315) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
  at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
  at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
  at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81) [jsf-impl-2.2.8-jbossorg-1.jar:]
  at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.2.8-jbossorg-1.jar:]
  at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198) [jsf-impl-2.2.8-jbossorg-1.jar:]
  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
  ... 42 more

我怀疑这个问题是因为我的jsf或富有面孔的罐子,但是我正在研究这个问题。

如果有人知道解决方案,请告诉我。

2 个答案:

答案 0 :(得分:1)

这是由Seam 2.3.x和JSF 2.2组合引起的。您需要{J}兼容migrate SeamDeltaSpike,或者WildFly中的downgrade Mojarra 2.2.x到2.1.x.

技术问题是,Seam使用的an Application implementation没有从javax.faces.application.ApplicationWrapperit had to manually implement/delegate all Application methods to the wrapped application正确延伸。对于Seam 2.3.x,所有这些方法都基于JSF 2.1。在JSF 2.2中,Application添加了一个新方法getFlowHandler(),该方法未被Seam正确委派,因此返回null,导致依赖链中的所有麻烦它不是null。如果Seam人员从ApplicationWrapper正确扩展而不是硬编码特定JSF版本的所有委托方法,那么它将完美地适用于JSF版本。

另见:

答案 1 :(得分:0)

我已经确定了根本原因,问题是因为jar版本,将jar版本降级为2.1.29-jbossorg-1,它对我有用。

为此,将jar添加到$ {JBOSS_HOME} / modules / system / layers / base / com / sun / jsf-impl / main /     并更新module.xml(在同一路径中可用)  “resource-root”标记指向新文件名。

参考:https://developer.jboss.org/thread/261071?sr=inbox&ru=123215