2010-07-03 67 views
1

我想在集羣模式下運行jboss服務器(5.1.0)。我在同一主機中有兩個節點。當我將這兩個節點作爲獨立的URL訪問時,效果很好。ViewExpired異常,同時嘗試負載均衡http請求

我正在使用Apache HTTP服務器來使用代理平衡器(使用代理服務器傳遞,代理反向配置)來負載平衡我的請求。當我訪問Apache服務器URL時,它會嘗試在兩臺機器之間進行負載平衡。

我得到這個錯誤往往無法恢復login.xhtml和相應的節點停止服務請求後,有人可以告訴我這裏發生了什麼?

Caused by: javax.faces.application.ViewExpiredException: viewId:/login.seam - Vi 
ew /login.seam could not be restored. 
     at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.jav 
a:185) 
     at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100) 
     at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.jav 
a:103) 
     at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) 
     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265) 

回答

2

這個例外與JSF有關。

web.xml中添加

<context-param> 

    <param-name>org.ajax4jsf.handleViewExpiredOnClient</param-name> 

    <param-value>true</param-value> 

</context-param> 

,並在所有頁面的頁眉(我會建議建立一個共同的標題)補充一點:

A4J.AJAX.onExpired = function(loc, expiredMsg){ 

    if(window.confirm("Custom onExpired handler "+expiredMsg+" for a location: "+loc)){ 

     return loc; 

    } else { 

    return false; 

    } 

} 

Read here more about handling this exception in RichFaces

+0

它不清楚爲什麼當它以集羣模式運行時,首先會獲得視圖過期異常。我們對我們的請求進行循環負載平衡。 – Achaius 2010-07-05 06:23:09