What are some of the common pitfalls when loadbalancing a GlassFish cluster using Apache over AJP/mod_jk?
Make sure that the name of each worker equals the value of the <code>jvmRoute</code> system property of the GlassFish instance to which the worker connects. Only then will it be possible for an HTTP session to remain sticky to the GlassFish instance on which the session was created, or on which the session was last resumed.
Mark the web applications you intend to deploy to the GlassFish cluster as distributable in their <code>web.xml</code> deployment descriptor, and deploy them to the cluster with the <code>--availabilityenabled</code> option of the <code>asadmin deploy</code> command set to <code>true</code> (default is <code>false</code>). This will enable the in-memory session replication feature of GlassFish for those web applications, and make it possible for their HTTP sessions to be resumed after a failover.