Re: Unable to store a session with Tomcat 7 linux and Internet Explorer

2011-02-04 Thread Brian Cross

Thanks very much Chris, Chuck, and Mark.  I did indeed have

org.apache.catalina.STRICT_SERVLET_COMPLIANCE=true in my CATALINA_OPTS.

I remember setting that a long time ago to fix a problem, but I can't remember 
what it was.

I added org.apache.tomcat.util.http.ServerCookie.FWD_SLASH_IS_SEPARATOR=false

as Mark suggested, and that fixed it right up.  Thanks again.

--Brian.

On 2/4/2011 5:35 PM, Mark Thomas wrote:

On 04/02/2011 22:02, Brian Cross wrote:

Hello Tomcat experts, I am looking at going from Tomcat 6 to 7 on Linux
and ran into a strange issue.  I cannot get an http session to stick
when using Internet Explorer. A new session gets created every time you
load the test page in IE only.  I have verified this issue on IE 6, IE
8, and IE9 beta. Chrome and Firefox work as expected. I am just trying
to get a session to stick, but in IE itcreates a new one for each
request. This does NOT happen when running Tomcat 7 on Windows.  Thanks
very much for your help!

My test code is justh3Session ID =%=request.getSession().getId()%/h3

Test URL (broken) on Tomcat 7:
http://www.tigernet.com:8180/t/test/sessiontest.jsp

Test URL (working) on Tomcat 6
http://www.tigernet.com/t/test/sessiontest.jsp

Old Bug possibly related?
https://issues.apache.org/bugzilla/show_bug.cgi?id=49525

Sort of.

Tomcat 7 is stricter in enforcing various specifications including the
cookie specification which states that / is not allowed in a cookie
value unquoted. Unfortunately / gets used a lot in cookies in the path
and if correctly quoted - i.e. path=/...  - IE chokes. Not exactly a
surprise considering just how badly IE adheres to the cookie specs. To
avoid exactly the issue you are seeing, Tomcat 7 does not enforce this
part of the specification by default.

I suggest a careful read of the following Tomcat 7 docs
http://tomcat.apache.org/tomcat-7.0-doc/config/systemprops.html with
particular reference to
org.apache.tomcat.util.http.ServerCookie.FWD_SLASH_IS_SEPARATOR and
org.apache.catalina. STRICT_SERVLET_COMPLIANCE. My guess is that you
have set one or other of these to true.

I usually run Tomcat with the following:
org.apache.catalina. STRICT_SERVLET_COMPLIANCE=true
org.apache.tomcat.util.http.ServerCookie.FWD_SLASH_IS_SEPARATOR=false

Mark

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



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



Mem Leak / Too Many ServerCookie instances?

2007-02-23 Thread Brian Cross
Hello, I have been trying to figure out the cause of a memory leak in my 
web application that causes java.lang.OutOfMemoryError: GC overhead 
limit exceeded and java.lang.OutOfMemoryError: Java heap space errors.
This happens about once a day after heavy load.  I am using dumps from 
jmap and jhat to parse the dump. 

It seems like there are more instances of 
org.apache.tomcat.util.http.ServerCookie than there should be and they 
seem to be taking up a fairly big piece of memory.  Usually there are 
300 or so busy http threads, and there are 299 instances of 
org.apache.tomcat.util.http.Cookies, but it looks like there are 4549 
instances of ServerCookie, which seems weird to me. 
I guess that is around 15 cookies per request.  It looks like the 
ServerCookie instances are taking up  100 meg.  Maybe this is totally 
normal but I'm just starting with what is taking up the biggest chunk of 
memory and going from there.
If anyone has any information or advice, I would really appreciate it.  
Here is a trace down from the heap histogram.  The  means I drilled 
down into that class.



Heap Histogram

All Classes (excluding platform)
Class  Instance Count 
   Total Size


class [B   56760 
   614689141   
class [C   1124519 
   312509218
class [I  107844 
 92680628

class [Ljava.util.HashMap$Entry; 40941   26222864
class java.lang.String  965281   
19305620

class [Ljava.util.Hashtable$Entry; 57747 7655160
class [Ljava.lang.Object;  79781 
7227456

class java.util.HashMap$Entry244617 6849276
class java.util.Hashtable$Entry199424 
5583872
class [Ljava.lang.String;57062 
   5558752



 Referrers by Type


Class  
Instance Count


org.apache.tomcat.util.buf.ByteChunk 18696 (33%) 
(203mb) 

[Ljava.lang.Object; 11986
[[B   9990
java.nio.HeapByteBuffer   6200
com.mysql.jdbc.Buffer  2429
com.mysql.jdbc.Field2217


org.apache.tomcat.util.buf.MessageBytes 44576 


org.apache.tomcat.util.http.ServerCookie 22665 
org.apache.tomcat.util.http.MimeHeaderField   12480
org.apache.coyote.Request4488


[Lorg.apache.tomcat.util.http.ServerCookie;  4549

org.apache.tomcat.util.http.Cookies 299



Thanks again,

--Brian.



Re: Tomcat randomly hangs

2007-01-26 Thread Brian Cross
I have not tried this since it said this applied only to 2.4 kernels, 
but I am willing to try anything at this point, thanks!


Zsolt Koppany wrote:

Did you try:

export LD_ASSUME_KERNEL=2.2.5
or
export LD_ASSUME_KERNEL=2.4.1

tomcat start

Zsolt 

  

-Original Message-
From: Brian Cross [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 25, 2007 7:23 PM
To: users@tomcat.apache.org
Subject: Tomcat randomly hangs

Hello and thanks in advance for any advice.

We have Tomcat 5.5.20 running standalone on the following system:

Dual AMD Opteron
4 gig of memory
Debian Linux 2.6.8 amd64 smp kernel
latest sun java 1.5, 1.6, ibm 1.5 (happens on all 3 VM's)
Tomcat 5.5.20 (originally happened on 5.5.16, upgrade didn't help)

Randomly it will hang and stop accepting connections on port 80,
sometimes even late at night when there is not much traffic.

When the hang occurs:

* Can't access any web app on tomcat including the tomcat manager
* Telnet to port 80 hangs(Coyote running on port 80)
* load goes up, but only slightly (from  1 to maybe 3 or 4)
* sometimes after a couple of minutes it starts responding again,
sometimes it doesn't.
* when I run shutdown.sh the java process continues to run and I have to
kill -9 to stop it
* I try to do a kill -3 or kill -QUIT on the java process to get a
thread dump, but it does not work

I have tried many different jvm settings and tomcat connector settings,
here is what I have currently:

Connector port=80 maxHttpHeaderSize=8192
   maxThreads=1000 minSpareThreads=50 maxSpareThreads=100
   enableLookups=false redirectPort=8443 acceptCount=100
   connectionTimeout=2 strategy=ms
disableUploadTimeout=false /

CATALINA_OPTS=-server -XX:MaxPermSize=256m -ms512m -mx1280m -Xss96k
-Djava.awt.headless=true

I would really appreciate any advice, I really don't know where to go
from here to try and figure it out.  If I can't figure it out soon my
plan is to use apache2 as the webserver and connect to tomcat via JK.

Thanks so much for your expert advice!

--Brian.

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




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

  


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



Re: Tomcat randomly hangs

2007-01-26 Thread Brian Cross
Good idea, I have not tested the memory.  The only tool I found was 
memtest86 but it looks like you need access to the machine to use it.  
Unfortunately the machine is in another state and I just manage it via 
ssh.  I will see if I can find any other tools that I can run via ssh.  
Thanks.


Leon Rosenberg wrote:


Brian,

have you actually tested the memory of the machine?

Leon



Stefan Baramov wrote:
 Since you all are using Java 5 why do you try to enable JMX. JConsole
 could give you a good insight on threads. It could even provide thread
 dump or possibly detect deadlock.

 - Stefan

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




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




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



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



Re: Tomcat randomly hangs

2007-01-26 Thread Brian Cross
Well I tried this and it seems to hose the whole system.  After 
re-logging as root with the new .bashrc all I got was this for any 
command I tried:


cat: error while loading shared libraries: libc.so.6: cannot open shared 
object file: No such file or directory


luckily I had another root session open and just took out the 
LD_ASSUME_KERNEL line which fixed it, but that was a close one.  I just 
wanted to warn anyone that has a 2.6 kernel not to try this.  Thanks.


Brian Cross wrote:
I have not tried this since it said this applied only to 2.4 kernels, 
but I am willing to try anything at this point, thanks!


Zsolt Koppany wrote:

Did you try:

export LD_ASSUME_KERNEL=2.2.5
or
export LD_ASSUME_KERNEL=2.4.1

tomcat start

Zsolt
 

-Original Message-
From: Brian Cross [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 25, 2007 7:23 PM
To: users@tomcat.apache.org
Subject: Tomcat randomly hangs

Hello and thanks in advance for any advice.

We have Tomcat 5.5.20 running standalone on the following system:

Dual AMD Opteron
4 gig of memory
Debian Linux 2.6.8 amd64 smp kernel
latest sun java 1.5, 1.6, ibm 1.5 (happens on all 3 VM's)
Tomcat 5.5.20 (originally happened on 5.5.16, upgrade didn't help)

Randomly it will hang and stop accepting connections on port 80,
sometimes even late at night when there is not much traffic.

When the hang occurs:

* Can't access any web app on tomcat including the tomcat manager
* Telnet to port 80 hangs(Coyote running on port 80)
* load goes up, but only slightly (from  1 to maybe 3 or 4)
* sometimes after a couple of minutes it starts responding again,
sometimes it doesn't.
* when I run shutdown.sh the java process continues to run and I 
have to

kill -9 to stop it
* I try to do a kill -3 or kill -QUIT on the java process to get a
thread dump, but it does not work

I have tried many different jvm settings and tomcat connector settings,
here is what I have currently:

Connector port=80 maxHttpHeaderSize=8192
   maxThreads=1000 minSpareThreads=50 maxSpareThreads=100
   enableLookups=false redirectPort=8443 acceptCount=100
   connectionTimeout=2 strategy=ms
disableUploadTimeout=false /

CATALINA_OPTS=-server -XX:MaxPermSize=256m -ms512m -mx1280m -Xss96k
-Djava.awt.headless=true

I would really appreciate any advice, I really don't know where to go
from here to try and figure it out.  If I can't figure it out soon my
plan is to use apache2 as the webserver and connect to tomcat via JK.

Thanks so much for your expert advice!

--Brian.

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




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

  


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



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



Re: Tomcat randomly hangs - new info

2007-01-26 Thread Brian Cross
Well after turning on vebose garbage collect I found out what the hang 
really is.  For some reason the garbage collector gets in a state where 
it tries to do a full GC but cannot for some unknown reason.  Here is 
what the verbose gc looks like on the hang:


7007.950: [Full GC [PSYoungGen: 157503K-157492K(206656K)] [PSOldGen: 
699071K-699071K(699072K)
] 856575K-856564K(905728K) [PSPermGen: 115222K-115222K(115520K)], 
1.1234380 secs]
7009.075: [Full GC [PSYoungGen: 157504K-157504K(206656K)] [PSOldGen: 
699071K-699071K(699072K)
] 856575K-856575K(905728K) [PSPermGen: 115222K-115222K(115520K)], 
1.1220980 secs]
7010.198: [Full GC [PSYoungGen: 157504K-157504K(206656K)] [PSOldGen: 
699071K-699071K(699072K)
] 856575K-856575K(905728K) [PSPermGen: 115222K-115222K(115520K)], 
1.1215690 secs]


this repeats forever...

I was actually able to get a thread dump but I don't really know what to 
look for.  I realize this is almost certainly not a tomcat issue so I 
won't post anymore about it, but I thought I would just give an 
update.   Thanks for all the suggestions.


--Brian.

Brian Cross wrote:

Hello and thanks in advance for any advice.

We have Tomcat 5.5.20 running standalone on the following system:

Dual AMD Opteron
4 gig of memory
Debian Linux 2.6.8 amd64 smp kernel
latest sun java 1.5, 1.6, ibm 1.5 (happens on all 3 VM's)
Tomcat 5.5.20 (originally happened on 5.5.16, upgrade didn't help)

Randomly it will hang and stop accepting connections on port 80, 
sometimes even late at night when there is not much traffic.


When the hang occurs:

* Can't access any web app on tomcat including the tomcat manager
* Telnet to port 80 hangs(Coyote running on port 80)
* load goes up, but only slightly (from  1 to maybe 3 or 4)
* sometimes after a couple of minutes it starts responding again, 
sometimes it doesn't.
* when I run shutdown.sh the java process continues to run and I have 
to kill -9 to stop it
* I try to do a kill -3 or kill -QUIT on the java process to get a 
thread dump, but it does not work


I have tried many different jvm settings and tomcat connector 
settings, here is what I have currently:


Connector port=80 maxHttpHeaderSize=8192
  maxThreads=1000 minSpareThreads=50 maxSpareThreads=100
  enableLookups=false redirectPort=8443 acceptCount=100
  connectionTimeout=2 strategy=ms 
disableUploadTimeout=false /


CATALINA_OPTS=-server -XX:MaxPermSize=256m -ms512m -mx1280m -Xss96k 
-Djava.awt.headless=true


I would really appreciate any advice, I really don't know where to go 
from here to try and figure it out.  If I can't figure it out soon my 
plan is to use apache2 as the webserver and connect to tomcat via JK.


Thanks so much for your expert advice!

--Brian.

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



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



Tomcat randomly hangs

2007-01-25 Thread Brian Cross

Hello and thanks in advance for any advice.

We have Tomcat 5.5.20 running standalone on the following system:

Dual AMD Opteron
4 gig of memory
Debian Linux 2.6.8 amd64 smp kernel
latest sun java 1.5, 1.6, ibm 1.5 (happens on all 3 VM's)
Tomcat 5.5.20 (originally happened on 5.5.16, upgrade didn't help)

Randomly it will hang and stop accepting connections on port 80, 
sometimes even late at night when there is not much traffic.


When the hang occurs:

* Can't access any web app on tomcat including the tomcat manager
* Telnet to port 80 hangs(Coyote running on port 80)
* load goes up, but only slightly (from  1 to maybe 3 or 4)
* sometimes after a couple of minutes it starts responding again, 
sometimes it doesn't.
* when I run shutdown.sh the java process continues to run and I have to 
kill -9 to stop it
* I try to do a kill -3 or kill -QUIT on the java process to get a 
thread dump, but it does not work


I have tried many different jvm settings and tomcat connector settings, 
here is what I have currently:


Connector port=80 maxHttpHeaderSize=8192
  maxThreads=1000 minSpareThreads=50 maxSpareThreads=100
  enableLookups=false redirectPort=8443 acceptCount=100
  connectionTimeout=2 strategy=ms 
disableUploadTimeout=false /


CATALINA_OPTS=-server -XX:MaxPermSize=256m -ms512m -mx1280m -Xss96k 
-Djava.awt.headless=true


I would really appreciate any advice, I really don't know where to go 
from here to try and figure it out.  If I can't figure it out soon my 
plan is to use apache2 as the webserver and connect to tomcat via JK.


Thanks so much for your expert advice!

--Brian.

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



Re: Tomcat randomly hangs

2007-01-25 Thread Brian Cross
Christopher, thanks for the reply.  Yes I have checked all the logs and 
there are no warnings or errors when the hang occurs.
You are right that since the VM appears to hang, fronting with apache 
may not help but it would rule out the Coyote connector at least.


One other thing I did notice is that in the tomcat manager server status 
page there are some connections that seem to be hung, for example:


Stage   TimeB Sent  B Recv

*S* 28604 ms24 KB   0 KB

*S* 1273330 ms  16 KB   0 KB

*S* 829528 ms   16 KB   0 KB

*S* 1293854 ms  16 KB   0 KB

*S* 1331406 ms  16 KB   0 KB

*S* 329442 ms   16 KB   0 KB


I picked out the ones with the highest value for Time out of the 185 
active threads.  Most threads are in the K or R state.
I have the connectionTimeout on the connector set to 20 seconds so I 
don't understand what these threads are doing.

Maybe this is a clue?  Thanks!

--Brian.

Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Brian,

Brian Cross wrote:
  

I would really appreciate any advice, I really don't know where to go
from here to try and figure it out.  If I can't figure it out soon my
plan is to use apache2 as the webserver and connect to tomcat via JK.



You didn't explicitly say that you did, so I have to ask: you looked in
all your log files, right?

If your VM really is crashing/hanging/whatever, then adding Apache httpd
out front is unlikely to change anything.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFuQOy9CaO5/Lv0PARAgvTAKCPlHuIIHdZh09xubolGgShG0wASQCfY9/8
VAp2J+4kxL9tOw951u7xtmk=
=C/L8
-END PGP SIGNATURE-

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

  


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



Re: Tomcat randomly hangs

2007-01-25 Thread Brian Cross
Thanks for the suggestion Stefan.  Yes I have run JConsole and will look 
at it some more.  When the hang happens JConsole stops responding as well.


Stefan Baramov wrote:

Since you all are using Java 5 why do you try to enable JMX. JConsole
could give you a good insight on threads. It could even provide thread
dump or possibly detect deadlock.

- Stefan

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

  



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