Hi Guys,

Thanks for your feedback with this issue. This has been making me crazy for
such a long time.

I have put this in last night and tested. 

   <VirtualHost *:80>
        JkMount /*.jsp loadbalancer
        JkMount /*.jsf loadbalancer
        JkMount /* loadbalancer
        JkMount /servlet/* loadbalancer

        JkMount /a4j_3_2_2-SNAPSHOTorg/* loadbalancer
        JkStripSession On


It does not work again. Strange it works for a while then when the session
times out there seems to be an issue.

78.124.0.12 - - [05/May/2009:09:43:51 -0400] "GET /login.jsf HTTP/1.1" 200
3370 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR
1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0; FDM; .NET CLR 2.0.50727)"

== 404 here after a 200 ====

78.124.0.12 - - [05/May/2009:09:43:52 -0400] "GET
/a4j_3_2_2-SNAPSHOTorg/richfaces/renderkit/html/css/basic_classes.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__.jsf;jsessionid=FFC14D3D01CF7F18460147292A996BF8.tomcat3
HTTP/1.1" 404 7014 "http://www.myAppName.com/login.jsf"; "Mozilla/4.0
(compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322;
Media Center PC 4.0; FDM; .NET CLR 2.0.50727)"
78.124.0.12 - - [05/May/2009:09:43:52 -0400] "GET
/a4j_3_2_2-SNAPSHOTorg/richfaces/renderkit/html/css/extended_classes.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__.jsf;jsessionid=FFC14D3D01CF7F18460147292A996BF8.tomcat3
HTTP/1.1" 404 7014 "http://www.myAppName.com/login.jsf"; "Mozilla/4.0
(compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322;
Media Center PC 4.0; FDM; .NET CLR 2.0.50727)"
78.124.0.12 - - [05/May/2009:09:43:52 -0400] "GET /css/stylesheet.css
HTTP/1.1" 304 - "http://www.myAppName.com/login.jsf"; "Mozilla/4.0
(compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322;
Media Center PC 4.0; FDM; .NET CLR 2.0.50727)"
78.124.0.12 - - [05/May/2009:09:43:52 -0400] "GET /js/jquery-1.2.3.pack.js
HTTP/1.1" 304 - "http://www.myAppName.com/login.jsf"; "Mozilla/4.0
(compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322;
Media Center PC 4.0; FDM; .NET CLR 2.0.50727)"
78.124.0.12 - - [05/May/2009:09:43:53 -0400] "GET
/js/jquery.jcarousel.pack.js HTTP/1.1" 304 -
"http://www.myAppName.com/login.jsf"; "Mozilla/4.0 (compatible; MSIE 7.0;
Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0;
FDM; .NET CLR 2.0.50727)"


I am going to try the 
RewriteRule /contextPath/(.*);jsessionid=[0-9A-Z]*(.*)
/path/to/webapps/contextPath/$1$2 [L] 

I will let you know how it goes. 

Fell free to add anything you might have thought of to this thread. All is
appreciated.

Thanks
Phil




Christopher Schultz-2 wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> André,
> 
> On 5/4/2009 1:50 PM, André Warnier wrote:
>> I was not quite convinced by Chris's explanation, so I tested this by
>> myself.
> 
> [snip]
> 
>> So, despite my initial scepticism (for which I apologise), Chris turns
>> out to be right.
> 
> Sometimes it's goog to convince yourself of something, rather than
> accepting it as fact. That's always a good advice with statements made
> on this list (and on the Internet in general). No offense taken.
> 
>> I don't think that mod_jk, even with the "JkStripSession" parameter on,
>> will scan each page returned by Tomcat, and /in the content/ change
>> these links to remove the ";jsessionid=..." part.
> 
> It does not have to. The links are only a problem when the web server
> attempts to service them. If the ";jsessionid=..." is stripped-away
> before the files are located, then everything is okay.
> 
>> So the questions would be :
>> 1) /why/ does the page returned by Tomcat contain the embedded  
>> tags with a "....;jsessionid=...." URI ?
>> What puts that jession-id there ?
> 
> All URLs should be run through HttpServletResponse.encodeURL, which adds
> the ";jsessionid=..." if the container isn't sure that the client
> supports cookies. This allows sessions to be used even if cookies are
> unavailable. It's also required by the Servlet Spec.
> 
>> OR
>> 2) what makes it so that when Tomcat returns that page, Apache+mod_jk
>> think that this css URI does /not/ have to be forwarded to Tomcat ?
> 
> The OP never set *.css to be served by Tomcat. Had this been the case,
> everything would have been okay, since Tomcat knows how to use the
> ";jsessionid=..." parameter (and also knows how to ignore it properly,
> thank you very much httpd!).
> 
>> There must be, at the Apache level, a rogue JkUnMount or SetEnvIf no_jk
>> rule that interferes there, in the sense of not being quite smart enough
>> to know that this link /should/ be forwarded to Tomcat.
>> 
>> And if it should /not/ be forwarded to Tomcat after all, then you should
>> use a smart RewriteRule that will strip the ";jsessionid.." from these
>> URI's, before Apache attempts to find them locally.
> 
> FWIW that rule is this:
> 
> RewriteRule /contextPath/(.*);jsessionid=[0-9A-Z]*(.*)
> /path/to/webapps/contextPath/$1$2 [L]
> 
> (I've been around this particular block several times. Bless Rainer and
> Mladen for adding JKStripSession!).
> 
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAkn/UWMACgkQ9CaO5/Lv0PBBugCcDCCMSVpYGWwnD8zT9zXI01kV
> 8pcAoL+6BkMfZHc06JImiWhvaSnobUg9
> =n6KO
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/I-have-a-problem-with-Apache%2C-Tomcat-tp23322605p23387754.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to