Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

Prohibiting session crossover for multiple JBoss instances

Thread view: 
NathanIEI - 07 Mar 2007 23:22 GMT
It seems that I have quite the reverse situation from almost every one
else on the subject of session sharing. Unlike most post I've seen, I
DO NOT want to share the session.

I've setup 3 instances of JBoss servers on one machine (localhost:
8080, localhost:8180, localhost:8280) to which I am deploying the same
ear file, for concurrent Q/A testing by different teams. The setup is
good, and works fine, but a problem is introduced when I switch from
one server to the next within the same browser.

I think the problem is that the path variable of the JSESSIONID cookie
holds the same context in all three servers. (ex. path =/mywebapp)
This causes the context to be localhost/mywebapp for all three servers
since the port number isn't taken into consideration. The session is
then considered invalid when the server is switched, and a new session
issued every time you cross a server. I need to be able to have each
session run concurrently with the other, relative to it's own server
instance.

I can explicitly change the <context-root> and repackage for each
server, forcing the path to be different in each cookie, but that can
be a bit cumbersome with the companie's deployment practices. I've
devised a solution that will allow me to change the context depending
on the server:

<context-root>${jboss.server.name}/mywebapp</context-root>

This is fine for testing, but has a negative impact on production.
When the app is deployed to the 'default' (single instance)
configuration in production, you have an unnecessary and ugly addition
to the path like http://myserver/default/mywebapp instead of the //
myserver/mywebapp as preferred.

Anyone have any ideas how to prevent/solve this?

Thanks in advance for *any* help!
Chris Uppal - 08 Mar 2007 19:05 GMT
> I've setup 3 instances of JBoss servers on one machine (localhost:
> 8080, localhost:8180, localhost:8280) to which I am deploying the same
> ear file, for concurrent Q/A testing by different teams. The setup is
> good, and works fine, but a problem is introduced when I switch from
> one server to the next within the same browser.

Wouldn't it be sufficient to give all three servers different hostnames.  E.g.
alias localhost 127.0.0.1 (localhost) to local-qa1, local-qa2, and local-qa3.
That way, I think, the browser should treat them as being in different
"domains" (in cookie-speak).

You may have to tell the three JBoss installations that they are serving
requests to (respectively) http://local-qa1/, http://local-qa2/, and
http://local-qa3/ -- if not, /and/ if they are set up for multi-homed
service[*], then they'll refuse to play when they see an HTTP request for stuff
on, say,
   host: local-qa2
when they don't have "local-qa2" configured.

BTW, I have never tried this -- it's pure guesswork (or "theory" as we call it
in the trade ;-)

   -- chris

[*] I assume that JBoss knows about multi-homing, but I don't know for sure,
and I certainly don't know whether that's configured by default.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.