javax.faces.context.FacesContext.isReleased(FacesContext.java:609) 处的 java.lang.UnsupportedOperationException

发布于 2024-11-10 08:24:39 字数 2219 浏览 1 评论 0原文

我正在集成 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>

请参阅这篇文章了解上下文 链接

I am integrating SWF 2.2.1,Primefaces 2.2.1,JSF 2,Spring Security 3,Spring 3.1.0M1.
I am able to hit my first page mentioned in Spring web-flow xml, but getting following error.

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)

And to my surprise I only have minimal code in my .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>

Please see this post also for the context
link

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

鹿童谣 2024-11-17 08:24:39

一些事实:

因此,要解决这个问题,有几种选择:

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

Some facts:

  • According to the appearance of Tomcat specific classes in the stacktrace in your other question you're using Tomcat.
  • According to the appearance of the JSF 2.1 introduced FacesContext#isReleased() method in the stacktrace in your current question, you're using JSF 2.1.
  • According to the answer in your other question, you're probably using Mojarra 2.1.0.
  • Mojarra 2.1.0 does not work in Tomcat/Jetty due to a major mistake of accidently introducing Glassfish specific code in the annotation scanning implementation for containers which does not ship with builtin annotation scanners.

So, to solve this problem there are several options:

  • Downgrade to Mojarra 2.0.5.
  • Upgrade to Mojarra 2.1.1.
  • Replace Tomcat by Glassfish 3, JBoss AS 6 or something else.
寂寞美少年 2024-11-17 08:24:39

你用的是汤姆猫吗?如果是这样,根据 线程。

Are you using Tomcat? If so, revert back JSF version from 2.1.0 to the latest 2.0.x stable release, according to this thread.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文