【问题标题】:java.lang.UnsupportedOperationException at javax.faces.context.FacesContext.isReleased(FacesContext.java:609)java.lang.UnsupportedOperationException 在 javax.faces.context.FacesContext.isReleased(FacesContext.java:609)
【发布时间】:2011-09-04 20:27:01
【问题描述】:

我正在集成 SWF 2.2.1、Primefaces 2.2.1、JSF 2、Spring Security 3、Spring 3.1.0M1。 我可以访问 Spring web-flow xml 中提到的第一页,但出现以下错误。

com.sun.faces.application.view.FaceletViewHandlingStrategy handleRenderException
SEVERE: Error Rendering View[/WEB-INF/flows/AccSrch/searchAccIns.xhtml]
java.lang.UnsupportedOperationException
at javax.faces.context.FacesContext.isReleased(FacesContext.java:609)
at com.sun.faces.context.PartialViewContextImpl.updateFacesContext(PartialViewContextImpl.java:468)
at com.sun.faces.context.PartialViewContextImpl.isAjaxRequest(PartialViewContextImpl.java:108)
at javax.faces.context.PartialViewContextWrapper.isAjaxRequest(PartialViewContextWrapper.java:117)
at javax.faces.component.UIViewRoot.getRendersChildren(UIViewRoot.java:1020)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1755)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:401)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
at org.springframework.faces.webflow.FlowViewHandler.renderView(FlowViewHandler.java:99)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at org.springframework.faces.webflow.FlowLifecycle.render(FlowLifecycle.java:80)
at org.springframework.faces.webflow.JsfView.render(JsfView.java:90)

令我惊讶的是,我的 .xhtml 中只有最少的代码

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://java.sun.com/jsf/facelets"
   xmlns:h="http://java.sun.com/jsf/html"
   xmlns:f="http://java.sun.com/jsf/core"
   xmlns:p="http://primefaces.prime.com.tr/ui">
   <ui:define name="content">
      <f:view>
         <h:form id="expire" prependId="false">
            <h:outputText value="HEllo" />
         </h:form>
      </f:view>
   </ui:define>
</ui:composition>

请参阅这篇文章以了解上下文 link

【问题讨论】:

    标签: java spring jsf jsf-2 spring-webflow


    【解决方案1】:

    一些事实:

    • 根据 your other question 中堆栈跟踪中 Tomcat 特定类的外观,您正在使用 Tomcat。
    • 根据 JSF 2.1 在您当前问题的堆栈跟踪中引入的FacesContext#isReleased() 方法的出现,您正在使用 JSF 2.1。
    • 根据您的另一个问题中的the answer,您可能正在使用 Mojarra 2.1.0。
    • Mojarra 2.1.0 does not work 在 Tomcat/Jetty 中,因为 major mistake 在未附带内置注释扫描器的容器的注释扫描实现中意外引入 Glassfish 特定代码。

    所以,解决这个问题有几个选择:

    • 降级到 Mojarra 2.0.5。
    • 升级到 Mojarra 2.1.1。
    • 用 Glassfish 3、JBoss AS 6 或其他东西替换 Tomcat。

    【讨论】:

      【解决方案2】:

      你在使用Tomcat吗?如果是这样,请根据this 线程将 JSF 版本从 2.1.0 恢复到最新的 2.0.x 稳定版本。

      【讨论】:

      • 这更奇怪了。我已将我的 jsf-api 和 jsp-impl 降级到 2.0.3。现在页面来了,同时我在控制台中也遇到了同样的错误(我在这个问题中发布的错误)。我应该用别的东西改变tomcat吗?请提出建议。
      • 我通过将 Primefaces 版本从 2.2.1 更改为 2.2.RC2 解决了这个问题。谢谢大家的帮助!!!
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-06-28
      • 1970-01-01
      • 1970-01-01
      • 2013-06-07
      • 2021-07-28
      相关资源
      最近更新 更多