users@glassfish.java.net

Re: jvmroute not added to sessionid.

From: Amy Roh <amy.roh_at_oracle.com>
Date: Wed, 03 Aug 2011 10:37:11 -0700

You just need to create a jvm option and restart the server. Try removing other jvmRoute properties under server.

asadmin create-jvm-options -DjvmRoute=MYINSTANCE
asadmin restart-domain

We have a unit test [1] for this feature and it is working fine.

asadmin-common-ignore-fail:
      [echo] asadmin create-jvm-options --user admin --passwordfile /files/hudson/workspace/webtier-dev-tests-v3/appserv-tests/config/adminpassword.txt --host localhost --port 60492 --echo=true --terse=true -DjvmRoute=MYINSTANCE
      [exec] asadmin --host localhost --port 60492 --user admin --passwordfile /files/hudson/workspace/webtier-dev-tests-v3/appserv-tests/config/adminpassword.txt --interactive=false --echo=true --terse=true create-jvm-options --target server -DjvmRoute=MYINSTANCE
      [exec] Created 1 option(s)

.......

run:
      [java] Connecting to:http://localhost:39495/web-session-jvm-route/CreateSession
      [java] Response cookie: JSESSIONID=fe6fdee65ca00039384468531ebc.MYINSTANCE; Path=/web-session-jvm-route; HttpOnly
      [java]
      [java] Connecting to: GET /web-session-jvm-route/CheckSession HTTP/1.0
      [java]
      [java] HTTP/1.1 200 OK
      [java] X-Powered-By: Servlet/3.0 JSP/2.2 (GlassFish Server Open Source Edition 3.2-SNAPSHOT Java/Sun Microsystems Inc./1.6)
      [java] Server: GlassFish Server Open Source Edition 3.2-SNAPSHOT
      [java] Set-Cookie: MYNAME=MYVALUE
      [java] Set-Cookie: JSESSIONID=fe6fdee65ca00039384468531ebc.MYINSTANCE; Path=/web-session-jvm-route; HttpOnly
      [java] Date: Wed, 03 Aug 2011 13:48:24 GMT
      [java] Connection: close
      [java] content-length: 0
      [java]
      [java] Generating report at /files/hudson/workspace/webtier-dev-tests-v3/appserv-tests/test_results.xml
      [java]
      [java]
      [java] -----------------------------------------
      [java] - session-jvm-route: PASS -
      [java] -----------------------------------------
      [java] - Total PASS : 1 -
      [java] - Total FAIL : 0 -
      [java] - Total DID NOT RUN : 0 -
      [java] -----------------------------------------


[1]
http://java.net/projects/glassfish/sources/svn/show/trunk/v2/appserv-tests/devtests/web/sessionJvmRoute

On 8/3/11 8:13 AM, forums_at_java.net wrote:
> Hi Shing,
>
> Yes, I have added it almost everywere:
>
> 1) as JVM parameters -DjvmRoute
> 2) as Instance propoerty
> 3) as Server property
>
> But it does not append jvmRoute to sessionId yet...
>
> Thanks a lot.
>
>
> --
>
> [Message sent by forum member 'osegarra']
>
> View Post: http://forums.java.net/node/828705
>
>