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

2024-05-12

我正在集成 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 https://stackoverflow.com/questions/6173114/getting-error-java-lang-noclassdeffounderror-javax-faces-component-behavior-cli


一些事实:

  • 根据Tomcat具体类在stacktrace中的出现情况你的另一个问题 https://stackoverflow.com/questions/6173114/getting-error-java-lang-noclassdeffounderror-javax-faces-component-behavior-cli你正在使用Tomcat。
  • 根据JSF 2.1的外观介绍FacesContext#isReleased() http://download.oracle.com/javaee/6/api/javax/faces/context/FacesContext.html#isReleased%28%29在当前问题的堆栈跟踪中的方法中,您使用的是 JSF 2.1。
  • 根据答案 https://stackoverflow.com/questions/6173114/getting-error-java-lang-noclassdeffounderror-javax-faces-component-behavior-cli/6173338#6173338在您的其他问题中,您可能正在使用 Mojarra 2.1.0。
  • 莫贾拉2.1.0不起作用 http://javaserverfaces.java.net/nonav/rlnotes/2.1.0/issues.html在 Tomcat/Jetty 中,由于重大错误 http://java.net/jira/browse/JAVASERVERFACES-1937意外地在未附带内置注释扫描仪的容器的注释扫描实现中引入了 Glassfish 特定代码。

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

  • 降级到 Mojarra 2.0.5。
  • 升级到 Mojarra 2.1.1。
  • 用 Glassfish 3、JBoss AS 6 或其他东西替换 Tomcat。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

javax.faces.context.FacesContext.isReleased(FacesContext.java:609) 处的 java.lang.UnsupportedOperationException 的相关文章

随机推荐