jsf-2 - SRVE0260E : The server cannot use the error page specified for your application to handle the Original Exception printed below

标签 jsf-2 exception-handling websphere custom-error-pages

我正在尝试在部署在 IBM WebSphere Application Server 8.0.0.8 上的 JSF 应用程序中使用一些错误页面。它们在 web.xml 中声明如下:

<error-page>
    <error-code>403</error-code>
    <location>/error403.jsp</location>
</error-page>
<error-page>
    <exception-type>javax.faces.application.ViewExpiredException</exception-type>
    <location>/expired.xhtml</location>
</error-page>
<error-page>
    <error-code>500</error-code>
    <location>/error500.xhtml</location>
</error-page>

但是,它们似乎不起作用。例如,当我收到 ViewExpiredException 时重新启动应用程序后,我没有重定向到错误页面,但我得到以下 SRVE0260E服务器日志中的错误:
Error Page Exception
SRVE0260E: The server cannot use the error page specified for your application to handle the Original Exception printed below.

Original Exception:
Error Message: javax.servlet.ServletException: /help.xhtmlNo saved view state could be found for the view identifier: /help.xhtml
Error Code: 500
Target Servlet: Faces Servlet
Error Stack:
javax.faces.application.ViewExpiredException: /help.xhtmlNo saved view state could be found for the view identifier: /help.xhtml
     at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:128)
     at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:172)
     at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:119)
     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:189)
     at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1230)
     at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:779)
     at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
     at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1071)
     at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3774)
     at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)
     at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:981)
     at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
     at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:453)
     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515)
     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:306)
     at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:84)
     at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
     at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
     at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
     at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
     at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
     at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
     at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
     at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1702)



Error Page Exception:
Error Message: javax.servlet.ServletException: WebBeans context with scope type annotation @RequestScoped does not exist within current thread
Error Code: 0
Target Servlet:
Error Stack:
javax.enterprise.context.ContextNotActiveException: WebBeans context with scope type annotation @RequestScoped does not exist within current thread
     at org.apache.webbeans.container.BeanManagerImpl.getContext(BeanManagerImpl.java:321)
     at org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.getContextualInstance(NormalScopedBeanInterceptorHandler.java:124)
     at org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.invoke(NormalScopedBeanInterceptorHandler.java:95)
     at org.apache.webbeans.conversation.ConversationImpl_$$_javassist_40.isTransient(ConversationImpl_$$_javassist_40.java)
     at org.apache.webbeans.jsf.WebBeansPhaseListener.beforePhase(WebBeansPhaseListener.java:93)
     at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersBefore(PhaseListenerManager.java:76)
     at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:160)
     at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:119)
     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:189)
     at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1230)
     at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:779)
     at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
     at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1071)
     at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:1385)
     at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:194)
     at com.ibm.ws.webcontainer.webapp.WebApp.sendError(WebApp.java:3276)
     at com.ibm.ws.webcontainer.webapp.WebApp.handleException(WebApp.java:3804)
     at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3785)
     at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)
     at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:981)
     at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
     at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:453)
     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515)
     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:306)
     at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:84)
     at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
     at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
     at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
     at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
     at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
     at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
     at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
     at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1702) 

这是怎么引起的,我该如何解决?

最佳答案

似乎错误页面处理正在通过 JSF 处理器,但由于某种原因 requestDestroyed() 方法已经触发结束请求上下文。 CDI PhaseListener 然后在找不到请求上下文时抛出异常。

您应该能够通过使用非基于 JSF 的错误页面来解决此问题。也许静态文件或 JSP 可以工作。

否则,我建议您打开 PMR,以便解决请求问题。

关于jsf-2 - SRVE0260E : The server cannot use the error page specified for your application to handle the Original Exception printed below,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22016846/

相关文章:

java - Primefaces,如何用另一个按钮折叠布局单元?

java - JSF 列表转换器

.net - 位置 0 处没有行

java - 在 Websphere 8.5 上使用 Spring 3.x 时响应已经提交

serialization - 当客户端状态保存打开时,ViewScoped bean 是否序列化到页面?

PHP - 将一个额外的参数(变量)传递给 set_exception_handler

java - 如何将捕获的异常与异步任务android中的标准异常进行比较?

tomcat - 将应用程序从 websphere 迁移到 tomcat

ant - 如何使用 Ant 将 portlet 部署到远程 WebSphere Portal?

jakarta-ee - Tomcat 6 看不到 jar 里的 bean