tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Axel Leucht" <axel.leu...@dokom.net>
Subject AW: Bean in session scope
Date Sat, 12 Jul 2008 11:46:26 GMT
I'd tested it today as Johny suggested and it works on one tomcat instance! 

My real webapplication though requires that two tomcat instances are
involved which needs session stickyness which is not used in my config:

	Proxy balancer://myCluster>
	   BalancerMember ajp://localhost:8009
	   BalancerMember ajp://localhost:7009
	</Proxy>
	<Location /examples/>
		ProxyPass balancer://mycluster/examples/
	</Location>

Can someone tell me how to achieve sticky sessions with mod_proxy and two
tomcat instances?

/Axel

-----Urspr√ľngliche Nachricht-----
Von: Johnny Kewl [mailto:john@kewlstuff.co.za] 
Gesendet: Sonntag, 6. Juli 2008 19:49
An: Tomcat Users List
Betreff: Re: Bean in session scope


----- Original Message ----- 
From: "Axel Leucht" <axel.leucht@dokom.net>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Sunday, July 06, 2008 6:05 PM
Subject: Bean in session scope


> I'm currently operating an Apache webserver 2.2.4 in front of an Apache
> tomcat 6.0.16. Both are working together via mod_proxy.
>
> I'm trying to execute the NumberGuess sample provided with tomcat via the
> webserver.
>
> I can access the webapp successfully. The jsp page declares a bean in
> session scope <jsp:useBean id="numguess" class="num.NumberGuessBean"
> scope="session"/> and doesn't work as any request creates a new Java-Bean!
>
> I can confirm that the constructor is run with any request, hence setting
> numGuesses to 0 and a new answer to find.
>
> When I change to scope="application", it works and of course everything
> works also when executed directly when accessing via tomcat.
>
> Can someone tell me what is wrong in my configuration?
>
> Here are the relevant lines in my httpd.conf:
> <Proxy balancer://mycluster>
> BalancerMember ajp://192.168.0.101:8009 route=checkov
> keepalive=On retry=30 ttl=60
> </Proxy>
> <Location /foo>
> ProxyPass balancer://mycluster/examples/jsp/
> stickysession=JSESSIONID timeout=5
> </Location>

I'm a JK kinda guy... the reason is that JK is made by TC guys, mod_proxy is

Apaches way, but hey apche is pretty hot... so here a huge guess... you got 
one machine, you dont need all the hassle of stickyness...

Try this...

<Location /examples/>
ProxyPass http://localhost:8080/examples/
ProxyPassReverse http://localhost:8080/examples/
</Location>

and try this for AJP...

<Location /examples/>
   ProxyPass ajp://localhost:8009/examples/
</Location>

cookies must get thru...

then try

<Proxy balancer://myCluster>
   BalancerMember ajp://localhost:8009
</Proxy>
<Location /examples/>
    ProxyPass balancer://myCluster/examples/
</Location>

On a single machine you dont need to bother with sticky sessions....
If no work... something else is wrong, like maybe cookies off in browser....
... a guess ;)

---------------------------------------------------------------------------
HARBOR : http://www.kewlstuff.co.za/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
--------------------------------------------------------------------------- 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message