2011-05-30 39 views
3

我正在整合SWF 2.2.1,Primefaces 2.2.1,JSF 2,Spring Security 3,Spring 3.1.0M1。 我能夠在Spring web-flow xml中打開我的第一個頁面,但遇到以下錯誤。java.lang.UnsupportedOperationException在javax.faces.context.FacesContext.isReleased(FacesContext.java:609)

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

回答

6

一些事實:

  • 根據堆棧跟蹤中的Tomcat特定類的外觀在your other question你正在使用Tomcat。
  • 根據JSF 2.1介紹的FacesContext#isReleased()方法出現在當前問題的stacktrace中,您使用的是JSF 2.1。
  • 根據the answer在你的其他問題,你可能使用Mojarra 2.1.0。
  • Mojarra 2.1.0 does not work Tomcat/Jetty由於major mistake意外地在註釋掃描實現中引入了Glassfish特定的代碼,這些代碼沒有附帶內置註釋掃描程序。

因此,要解決這個問題有幾種選擇:

  • 降級到2.0.5鑽嘴魚科。
  • 升級到Mojarra 2.1.1。
  • 用Glassfish 3,JBoss AS 6或其他東西替換Tomcat。
+0

解決!感謝您的幫助 – C4CodeE4Exe 2011-05-31 05:57:16

+0

不客氣。 – BalusC 2011-05-31 14:27:46

2

您使用的是Tomcat嗎?如果是這樣,根據this線程,將JSF版本從2.1.0恢復到最新的2.0.x穩定版本。

+0

這更奇怪。我已將jsf-api和jsp-impl降級到2.0.3。現在頁面即將到來,同時我也在控制檯中出現相同的錯誤(我在此問題中發佈的錯誤)。我應該用別的東西來改變tomcat。請建議。 – C4CodeE4Exe 2011-05-31 05:29:03

+0

我通過將Primefaces版本從2.2.1更改爲2.2.RC2來解決此問題。 感謝您的幫助! – C4CodeE4Exe 2011-05-31 05:56:47

相關問題