I've two jboss application server (on different machines and ip) and that i have setup apache as web server with this application server using mod_jk configuration. Apache web server can also be setup to load balance between both of these application servers.

Following may be the content of my employees.qualities file:

worker.list=portalworker1,portalworker2,portalbalancer

worker.portalbalancer.type=lb
worker.portalbalancer.balance_workers=portalworker1,portalworker2

worker.portalbalancer.sticky_session=True

# Application server 1 Portal application
worker.portalworker1.type=ajp13
worker.portalworker1.host=10.178.197.91
worker.portalworker1.port=8009
worker.portalworker1.lbfactor=1

# Application server 2 Portal application
worker.portalworker2.type=ajp13
worker.portalworker2.host=10.178.197.90
worker.portalworker2.port=8009
worker.portalworker2.lbfactor=1

However , presently request has been delivered to the application server (for eg. one request at application server 1 and also the second request to application server 2) that will obv. will not work.

I've also checked mod_jk sign in debug mode:

For first request

[Tue Dec 13 16:46:12.222 2011] [16097:47166030803776] [debug] get_most_suitable_worker::jk_lb_worker.c (946): searching worker for partial sessionid UH76jWj-q2yX39prlS-nBA**
[Tue Dec 13 16:46:12.222 2011] [16097:47166030803776] [debug] get_most_suitable_worker::jk_lb_worker.c (1001): found best worker portalworker2 (portalworker2) using method 'Request'

For second request:

[Tue Dec 13 16:46:12.434 2011] [16100:47166030803776] [debug] get_most_suitable_worker::jk_lb_worker.c (946): searching worker for partial sessionid UH76jWj-q2yX39prlS-nBA**
[Tue Dec 13 16:46:12.434 2011] [16100:47166030803776] [debug] get_most_suitable_worker::jk_lb_worker.c (1001): found best worker portalworker1 (portalworker1) using method 'Request'

This guarantees the sessionid's for just two requset are same, still different employees are located.

Any idea things i am doing wrong?

The issue was that I never added jvmRoute during my server.xml for my different application server to distinguish these servers, as well as useJK wasn't set to true in jboss-service.xml file.