We have an existing application running on Weblogic 8.1. Currently we are planning to make it running in a cluster. I am sure that we have to take some precautions at code level for smooth migration of the existing application to a cluster. I have been given a task to prepare a prilimenary checklist which has to be satisfied and based on these checklist we will change the code and promote to cluster. We have used JSP, Servlets, Stateless Session Bean & Entity Beans.
Regarding that I am requesting ranchers to put their valuable points. Let me add my findings.
1. All the objects which are keeping in session must be serializable.
Objects stored in a session should be serializable to support in-memory replication of sessions. Also consider the overhead of serializing very large objects. Test the performance to make sure it is acceptable.
Design for idempotence. Failure of a request or impatient users clicking again can result in duplicate requests being submitted. So the Servlets should be able to tolerate duplicate requests.
Avoid using instance and static variables in read and write mode because different instances may exist on different JVMs. Any state should be held in an external resource such as a database.
Avoid storing values in a ServletContext. A ServletContext is not serializable and also the different instances may exist in different JVMs.
Avoid using java.io.* because the files may not exist on all backend machines. Instead use getResourceAsStream().