Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8695429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:02:01+00:00 2026-06-13T01:02:01+00:00

I’m configuring an environment using Glassfish and mod_jk to provide load balancing and session

  • 0

I’m configuring an environment using Glassfish and mod_jk to provide load balancing and session replication.

My worker.properties is as follow:

worker.list=i1,i2,loadbalancer

# default properties for workers
worker.template.type=ajp13
worker.template.port=28080
worker.template.lbfactor=1
worker.template.socket_timeout=300

# properties for node1
worker.i1.reference=worker.template
worker.i1.host=10.0.0.93
#worker.worker1.host=node1

# properties for worker2
worker.i2.reference=worker.template
worker.i2.host=10.0.0.38
#worker.worker2.host=node2

# properties for loadbalancer
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=i1,i2

worker.loadbalancer.sticky_session=true

The steps I’ve done are:
Created two nodes, n1 and n2 managed centrally (via SSH) from my server:

create-node-ssh --sshuser ubuntu --sshkeyfile /home/ubuntu/acme-auction.pem --nodehost 10.0.0.93 --installdir /home/ubuntu/glassfish3 n1
create-node-ssh --sshuser ubuntu --sshkeyfile /home/ubuntu/acme-auction.pem --nodehost 10.0.0.38 --installdir /home/ubuntu/glassfish3 n2

Created a cluster c1:

create-cluster --properties 'GMS_DISCOVERY_URI_LIST=generate:GMS_LISTENER_PORT=9090' c1

Created two instances:

create-instance --cluster  c1 --node n1 i1
create-instance --cluster  c1 --node n2 i2

start-instance i1
start-instance i2

Created an http-listener and a network-listener

create-http-listener --listenerport 28080 --listeneraddress 0.0.0.0 --defaultvs server jk-connector
create-network-listener --protocol http-listener-1 --listenerport 28080 --jkenabled true --target c1-config jk-connector

Then I created the routes JVM option:

create-jvm-options --target c1 "-DjvmRoute=\${AJP_INSTANCE_NAME}"

…and the sysyem properties according to jvmRoute:

create-system-properties --target i1 AJP_INSTANCE_NAME=i1
create-system-properties --target i2 AJP_INSTANCE_NAME=i2

I expected to be able to use my application visiting server_ip/app_name.

If I look at the cookies I can see:

  • a JSESSIONIDVERSION, format: value:number_of_operation
  • a JSESSIONID, format: value.i1
  • a JREPLICA, format: i2

(or the same with i2 and i1 exchanged).
This let me suppose the replication is set correctly, but when I stop i1, what I obtain is a blank page and no changes in cookies (I suppose JSESSIONID should change the last part, “.i1” in “.i2” to make the request be routed to i2, am I wrong?).
Thanks,
Andrea

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T01:02:02+00:00Added an answer on June 13, 2026 at 1:02 am

    Actually, it was a Serialization problem that made not possibile to serialize session and (as a consequence) switch to the other instance.
    To make it serializable, just had to

    • make all object managed in the session implemet Serializable
    • for those who could not be serialized (eg EntityManager, Transactions…) add the “transient” modifier when declaring the property

    Hope it helps,
    Andrea

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have thousands of HTML files to process using Groovy/Java and I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.