views:

26

answers:

1

I am trying to run the jboss server (5.1.0) in clustered mode. I am having two nodes in the same host. When i access the two nodes as separate URLs it works well.

I am using a Apache HTTP server to load balance my requests using the Proxy balancer (with proxy pass, proxy reverse configurations). When I access the Apache server URL, it tries to load balance between 2 machines.

I get this error often could not restore the login.xhtml and the corresponding node stops serving requests there after, can someone tell me what is happening here?

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)
+1  A: 

Hi,

This exception has got to do with JSF.

add to web.xml

<context-param>

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

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

</context-param>

and in the header of all pages (I would recommend creating a common header) add this:

    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

Odelya
Its not clear why am getting the view expired exception in the first place, when it is running in a clustered mode. We do round robin load balancing of our requests.
Kalpana