Clustered JSF application

1

What does my application (JSF + Primefaces) need to have to work on a cluster?

I'm doing a test in a clustered 3 Tomcat environment (with session replication) and my test application does not work.

At first, I only included the <distributable/> tag in web.xml.

The app is very simple, just a @ManagedBean @SessionScope and an xhtml with a button to increment a variable.

When the request jumps from one server to another, the session is lost.

Note:

The environment seems to be set up right and working, as there is a JSP page that works.

Source: Ramki Java Blog - Tomcat Clustering Series

    
asked by anonymous 30.10.2014 / 18:12

1 answer

2

If you are using session tomcat you should do something to share the session between tomcat.

One approach is called a StickSession where you define only one machine for a given client and direct all calls to it. The problem with this approach is that if the machine crashes, the face session gets lost.

Another approach would be to save the session to the bank, so everything is persisted there and could be shared.

And another solution is this tomcat's own: link

    
30.10.2014 / 22:21