1

我正在尝试在 WebSphere 8.5 中部署一个 Web 应用程序。该应用程序具有以下特点。

  • 莫哈拉 2.1.13
  • Primefaces 3.4.2
  • 春季网络流2.3.1
  • 春天 3.1.2
  • JDK 1.6

这个应用程序在 Tomcat 7 中运行良好,但是当我们尝试将其部署到 WebSphere 中时,我们得到了NullPointerException以下堆栈跟踪。

javax.faces.component.UIComponentBase.restoreDeltaSystemEventListenerClassMap(UIComponentBase.java:1933)
javax.faces.component.UIComponentBase.restoreState(UIComponentBase.java:1765)
javax.faces.component.UIViewRoot.restoreState(UIViewRoot.java:1214)
javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1401)
javax.faces.component.UIViewRoot.processRestoreState(UIViewRoot.java:731)
org.springframework.faces.webflow.FlowViewStateManager.restoreComponentState(FlowViewStateManager.java:78)
org.springframework.faces.webflow.FlowViewStateManager.restoreView(FlowViewStateManager.java:203)
org.apache.myfaces.shared_impl.view.ViewDeclarationLanguageBase.restoreView(ViewDeclarationLanguageBase.java:106)
org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.restoreView(FaceletViewDeclarationLanguage.java:1438)
org.apache.myfaces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:278)
org.springframework.faces.webflow.FlowViewHandler.restoreFlowView(FlowViewHandler.java:144)
org.springframework.faces.webflow.FlowViewHandler.restoreView(FlowViewHandler.java:83)
org.springframework.faces.webflow.JsfViewFactory.getView(JsfViewFactory.java:105)
org.springframework.webflow.engine.ViewState.resume(ViewState.java:193)
org.springframework.webflow.engine.Flow.resume(Flow.java:545)
org.springframework.webflow.engine.impl.FlowExecutionImpl.resume(FlowExecutionImpl.java:258)
org.springframework.webflow.executor.FlowExecutorImpl.resumeExecution(FlowExecutorImpl.java:169)
org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:183)
org.springframework.faces.webflow.JsfFlowHandlerAdapter.handle(JsfFlowHandlerAdapter.java:48)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1214)
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:774)
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:456)
com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:125)
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:92)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter.doFilter(AbstractPreAuthenticatedProcessingFilter.java:88)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:192)
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:89)
com.csc.fsg.pcdSecurity.filter.CASFilter.doFilter(CASFilter.java:573)
com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:192)
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:89)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:192)
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:89)
com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:926)
com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1023)
com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:87)
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:895)
com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:195)
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:522)
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:311)
com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:87)
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1783)

我看到错误来自 MyFaces2,默认情况下 JSF 实现到 websphere 8.5,所以我尝试将 Mojarra 2.1.13 实现为共享库,但它不起作用(我按照 IBM 文档中的步骤操作)。

另一个奇怪的事情是应用程序渲染了主页,但是当它突然渲染时,这个错误就出现了。

  • 有人知道这个错误吗?
4

2 回答 2

1

皮耶罗,

要解决此问题,请在 web.xml 文件中添加或替换以下上下文参数并重新发布项目。

<context-param>
<param-name>javax.faces.PARTIAL_STATE_SAVING</param-name>
<param-value>false</param-value>
</context-param>

那是因为您正在为 WAS (myFaces) 使用默认的 JSF 实现,并且您是在 mojarra 中开发的,所以您需要设置它才能使用 myFaces。

萨卢多斯

于 2013-08-30T14:30:32.173 回答
0

我有:

  1. JSF 莫哈拉 2.1.7
  2. Primefaces 3.4.2
  3. Spring框架4.0.2.RELEASE
  4. Spring web flow 2.3.3.RELEASE
  5. 春季安全 3.2.0.RELEASE

我在这种模式下解决了:

  1. 更改 PARENT_LAST 中模块的类加载器

    ibm 文档(更改类加载器策略)

  2. 更改 JSF 提供程序

    ibm 文档(更改 jsf 提供程序)

  3. 重启服务器(重要!)

于 2014-03-03T11:19:20.957 回答