Re: tomcat hangs without anything

2010-03-11 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Maurice,

On 3/11/2010 3:42 PM, Maurice Mengel wrote:
 Hi!
 
 I am new to tomcat. It try to use it with some servlet (oaicat). It seems to
 run well on my pc at work, but I cannot run it on my laptop on which I would
 like to develop.
 
 I start it, it looks fine. And after a few seconds or minutes, I doesn't
 answer any response.

Do you mean that it refuses HTTP requests, or you get a connection but
nothing ever displays?

 I uninstalled already all unnecessary versions of java, tried with different
 version. Installed a new tomcat.
 
 
- windows xp
- I start tomcat with bin\startup.bat

Can you post everything that shows up on the console during Tomcat
startup? IIRC, bin\startup.bat leaves the window open and stdout just
goes to the terminal.

- jdk 1.6.0_14

Since you have the JDK, you should have a program called jstack.exe:
you can run that with the pid of the running JVM to see what all the JVM
threads are doing. Post the output of jstack.exe and we'll take a look.

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

iEYEARECAAYFAkuZV/QACgkQ9CaO5/Lv0PD4lwCeL4GM/6fSmNkbjrnOQ4ZocZgn
X1wAoKHRhGsPaZg9+TfZWdWY9jBxYY3A
=xuug
-END PGP SIGNATURE-

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



Re: tomcat hangs without anything

2010-03-11 Thread Maurice Mengel
1) thanks for the very quick response!

2) I get the static page, because it is still in the brower cache, browser
is loading, but never actually displays anything; after a very long time, a
timeout. How do you describe that?

3) yes stout goes to console, see attachment

4) here is the output of jstack.

It doesn't tell me much. Thanks in advance!
Maurice

2010-03-11 22:24:34
Full thread dump Java HotSpot(TM) Client VM (14.3-b01 mixed mode, sharing):

http-8080-1 daemon prio=6 tid=0x0344b000 nid=0x180c in Object.wait()
[0x03adf000]
   java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on 0x077d0068 (a
org.apache.tomcat.util.net.JIoEndpoint$Worker)
at java.lang.Object.wait(Object.java:485)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.await(JIoEndpoint.java:458)
- locked 0x077d0068 (a org.apache.tomcat.util.net.JIoEndpoint$Worker)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:484)
at java.lang.Thread.run(Thread.java:619)

TP-Monitor daemon prio=6 tid=0x03449800 nid=0x1e40 in Object.wait()
[0x03a7f000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on 0x077d00e8 (a
org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable)
at
org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable.run(ThreadPool.java:565)
- locked 0x077d00e8 (a
org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable)
at java.lang.Thread.run(Thread.java:619)

TP-Processor4 daemon prio=6 tid=0x031afc00 nid=0x13b0 runnable
[0x03a2f000]
   java.lang.Thread.State: RUNNABLE
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:390)
- locked 0x077d01c8 (a java.net.SocksSocketImpl)
at java.net.ServerSocket.implAccept(ServerSocket.java:453)
at java.net.ServerSocket.accept(ServerSocket.java:421)
at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:307)
at
org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:661)
at
org.apache.jk.common.ChannelSocket$SocketAcceptor.runIt(ChannelSocket.java:872)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
at java.lang.Thread.run(Thread.java:619)

TP-Processor3 daemon prio=6 tid=0x03441400 nid=0x1dec in Object.wait()
[0x039df000]
   java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on 0x077d0470 (a
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
at java.lang.Object.wait(Object.java:485)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:662)
- locked 0x077d0470 (a
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
at java.lang.Thread.run(Thread.java:619)

TP-Processor2 daemon prio=6 tid=0x03466400 nid=0x1db8 in Object.wait()
[0x0398f000]
   java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on 0x077d0510 (a
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
at java.lang.Object.wait(Object.java:485)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:662)
- locked 0x077d0510 (a
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
at java.lang.Thread.run(Thread.java:619)

TP-Processor1 daemon prio=6 tid=0x03448400 nid=0x1f60 in Object.wait()
[0x0393f000]
   java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on 0x077d05b0 (a
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
at java.lang.Object.wait(Object.java:485)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:662)
- locked 0x077d05b0 (a
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
at java.lang.Thread.run(Thread.java:619)

http-8080-Acceptor-0 daemon prio=6 tid=0x031b4c00 nid=0x173c runnable
[0x038ef000]
   java.lang.Thread.State: RUNNABLE
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:390)
- locked 0x092697e0 (a java.net.SocksSocketImpl)
at java.net.ServerSocket.implAccept(ServerSocket.java:453)
at java.net.ServerSocket.accept(ServerSocket.java:421)
at
org.apache.tomcat.util.net.DefaultServerSocketFactory.acceptSocket(DefaultServerSocketFactory.java:61)
at
org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:352)
at java.lang.Thread.run(Thread.java:619)

ContainerBackgroundProcessor[StandardEngine[Catalina]] daemon prio=6
tid=0x0345d400 nid=0x18dc waiting on condition [0x0389f000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
at java.lang.Thread.sleep(Native Method)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1579)
at java.lang.Thread.run(Thread.java:619)

GC Daemon 

Re: tomcat hangs without anything

2010-03-11 Thread André Warnier

Christopher Schultz wrote:


   - windows xp
   - I start tomcat with bin\startup.bat


Can you post everything that shows up on the console during Tomcat
startup? IIRC, bin\startup.bat leaves the window open and stdout just
goes to the terminal.


Not exactly.

When you start it via startup.bat, it opens another window inside of 
which Tomcat is running.  There, you do see Tomcat's stdout.
The problem is that if Tomcat stops or crashes, this window instantly 
closes, so you may miss the last messages.


If you start Tomcat with the command catalina.bat run however, then 
Tomcat runs in the same command window where you issued this command 
(iow it does not open a second window).
In that case, if Tomcat stops or crashes, the window does not close and 
you still see the messages if any.

You can stop Tomcat by entering CTRL-C once in the same window.




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



Re: tomcat hangs without anything

2010-03-11 Thread Maurice Mengel
As far as I can tell, it tells essentially the same. Now I am using
different jdk and the catalina.bat run command.

I didn't know I could copy from this windows at all. Usually, I use cygwin,
but this seems not to make anything easier.


C:\Apache\apache-tomcat-6.0.24bin\catalina.bat run
Using CATALINA_BASE:   C:\Apache\apache-tomcat-6.0.24
Using CATALINA_HOME:   C:\Apache\apache-tomcat-6.0.24
Using CATALINA_TMPDIR: C:\Apache\apache-tomcat-6.0.24\temp
Using JRE_HOME:C:\Java\jdk1.6.0_17
Using CLASSPATH:   C:\Apache\apache-tomcat-6.0.24\bin\bootstrap.jar
Mar 11, 2010 10:30:12 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal
performanc
e in production environments was not found on the java.library.path:
C:\Java\jdk
1.6.0_17\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\mingw\b
in;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program
Files\Inte
l\Wireless\Bin\;C:\Program Files\Diskeeper Corporation\Diskeeper\;C:\Program
Fil
es\ThinkPad\ConnectUtilities;C:\Program Files\Common Files\Lenovo;C:\Program
Fil
es\Lenovo\Client Security
Solution;;C:\strawberry\c\bin;C:\strawberry\perl\bin;C
:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Program
Files\QuickTime\QTSystem\;C
:\cygwin\bin;C:\Apache\ant\bin;C:\Apache\maven\bin;C:\Program
Files\Nmap;C:\Prog
ram Files\gs\gs8.70\bin
Mar 11, 2010 10:30:13 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Mar 11, 2010 10:30:13 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1152 ms
Mar 11, 2010 10:30:13 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Mar 11, 2010 10:30:13 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.24
Mar 11, 2010 10:30:13 PM org.apache.catalina.startup.HostConfig
deployDescriptor

INFO: Deploying configuration descriptor host-manager.xml
Mar 11, 2010 10:30:14 PM org.apache.catalina.startup.HostConfig
deployDescriptor

INFO: Deploying configuration descriptor manager.xml
Mar 11, 2010 10:30:14 PM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory docs
Mar 11, 2010 10:30:14 PM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory examples
Mar 11, 2010 10:30:15 PM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory oaicat
Mar 11, 2010 10:30:15 PM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory ROOT
Mar 11, 2010 10:30:15 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Mar 11, 2010 10:30:16 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Mar 11, 2010 10:30:16 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/63  config=null
Mar 11, 2010 10:30:16 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2628 ms



On Thu, Mar 11, 2010 at 10:32 PM, André Warnier a...@ice-sa.com wrote:

 Maurice Mengel wrote:


 3) yes stout goes to console, see attachment

  The list strips most attachments, and we did not get this one.
 You may need to paste the screen messages directly here, like you did with
 the jstack output.





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




Re: tomcat hangs without anything

2010-03-11 Thread Maurice Mengel
4) no other server. I uninstalled apache-http and didn't do anything to
tomcat config.

I hope this is what you ask me for:

  !-- A Connector represents an endpoint by which requests are received
 and responses are returned. Documentation at :
 Java HTTP Connector: /docs/config/http.html (blocking 
non-blocking)
 Java AJP  Connector: /docs/config/ajp.html
 APR (HTTP/AJP) Connector: /docs/apr.html
 Define a non-SSL HTTP/1.1 Connector on port 8080
--
Connector port=8080 protocol=HTTP/1.1
   connectionTimeout=2
   redirectPort=8443 /
!-- A Connector using the shared thread pool--
!--
Connector executor=tomcatThreadPool
   port=8080 protocol=HTTP/1.1
   connectionTimeout=2
   redirectPort=8443 /
--
!-- Define a SSL HTTP/1.1 Connector on port 8443
 This connector uses the JSSE configuration, when using APR, the
 connector should be using the OpenSSL style configuration
 described in the APR documentation --
!--
Connector port=8443 protocol=HTTP/1.1 SSLEnabled=true
   maxThreads=150 scheme=https secure=true
   clientAuth=false sslProtocol=TLS /
--

I am not sure if Tomcat starts to refuse after about 1 min or after a
certain no of requests. I would guess it usually takes about 1 min. Not
always the same time, though. Not always the same no of requests either.
Example: This time I was able to click 10 times on manager/status and list
applications before it froze. The next time it froze not even after 50
times. I wrote a line in this email and then it didn't work anymore.




On Thu, Mar 11, 2010 at 10:36 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Maurice,

 On 3/11/2010 4:26 PM, Maurice Mengel wrote:
  2) I get the static page, because it is still in the brower cache,
  browser is loading, but never actually displays anything; after a very
  long time, a timeout. How do you describe that?

 That sounds like a connection timeout, rather than a refusal. Basically,
 the OS accepts the connection to the socket, but then the server
 (Tomcat) never picks up the phone, and eventually a timeout occurs.

  3) yes stout goes to console, see attachment

 Your attachment was stripped: please just paste it into your next reply.

  4) here is the output of jstack.

 Everything looks okay in there to me. Can you post your Connector
 configuration(s) from conf/server.xml? Are you using any web server in
 front of Tomcat? You didn't mention it, but it's always good to check.

 The Tomcat's refusal to answer requests come after a certain number of
 requests are issued (say, the 10th request always fails), or a certain
 period of time (after 30 seconds, all failures)? Once you get yourself
 into this state, does Tomcat ever recover?

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

 iEYEARECAAYFAkuZYmAACgkQ9CaO5/Lv0PCtjACgpAzueLh7RoH2/6HoFKyIrMst
 FJcAn1Mhd68UoDYR30aEiANDa6lRCPdM
 =QHOo
 -END PGP SIGNATURE-

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




RE: tomcat hangs without anything

2010-03-11 Thread Caldarale, Charles R
 From: Maurice Mengel [mailto:mauricemen...@gmail.com]
 Subject: Re: tomcat hangs without anything
 
 4) here is the output of jstack.

Everything looks pretty normal here.

 http-8080-1 daemon prio=6 tid=0x0344b000 nid=0x180c in Object.wait()
 [0x03adf000]
    java.lang.Thread.State: WAITING (on object monitor)
     at java.lang.Object.wait(Native Method)
     - waiting on 0x077d0068 (a
 org.apache.tomcat.util.net.JIoEndpoint$Worker)
     at java.lang.Object.wait(Object.java:485)

The one above is waiting for a socket from the next connection attempt by the 
client.

 TP-Monitor daemon prio=6 tid=0x03449800 nid=0x1e40 in Object.wait()

The thread pool monitor, doing nothing, as usual.

 TP-Processor4 daemon prio=6 tid=0x031afc00 nid=0x13b0 runnable

This one is waiting for a connection over the AJP port (8009), which you likely 
aren't using.

 TP-Processor3 daemon prio=6 tid=0x03441400 nid=0x1dec
 TP-Processor2 daemon prio=6 tid=0x03466400 nid=0x1db8
 TP-Processor1 daemon prio=6 tid=0x03448400 nid=0x1f60

Idle worker threads, waiting for requests to show up.

 http-8080-Acceptor-0 daemon prio=6 tid=0x031b4c00 nid=0x173c runnable

This one is waiting for a connection over the HTTP port (8080).

 ContainerBackgroundProcessor[StandardEngine[Catalina]] daemon prio=6
 tid=0x0345d400 nid=0x18dc

A normal Tomcat background thread.

 GC Daemon daemon prio=2 tid=0x03194c00 nid=0x18f4 
 Low Memory Detector daemon prio=6 tid=0x02ca6800 nid=0x1e00 runnable
 CompilerThread0 daemon prio=10 tid=0x02ca3800 nid=0x1c6c
 Attach Listener daemon prio=10 tid=0x02ca2000 nid=0x1774 
 Signal Dispatcher daemon prio=10 tid=0x02ca0c00 nid=0x1a34 runnable
 Finalizer daemon prio=8 tid=0x02c62000 nid=0x1ea0 
 Reference Handler daemon prio=10 tid=0x02c5d400 nid=0x19c0

Standard JVM internal threads.
 
 main prio=6 tid=0x002a7400 nid=0x1528 runnable [0x0038f000]

The initial Tomcat thread, waiting for a shutdown command.

 VM Thread prio=10 tid=0x02c5bc00 nid=0x1c2c runnable
 VM Periodic Task Thread prio=10 tid=0x02cab800 nid=0x1db4

More internal JVM threads.

All looks perfectly normal for an idle Tomcat, waiting for clients to make 
requests.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.



RE: tomcat hangs without anything

2010-03-11 Thread Caldarale, Charles R
 From: Maurice Mengel [mailto:mauricemen...@gmail.com]
 Subject: Re: tomcat hangs without anything
 
 I hope this is what you ask me for:

It is, and it shows nothing unusual - all pretty standard settings.

 Example: This time I was able to click 10 times on manager/status and
 list applications before it froze.

What happens if you start another browser to connect to Tomcat with?

 I wrote a line in this email and then it didn't work anymore.

How much memory do you have on the system?  Is it oversubscribed?

Can you run JConsole and display what's going on inside the JVM Tomcat is 
using?  Might show heap exhaustion, although that would seem very unlikely 
based on the previously posted stack trace.  (Which was taken /after/ Tomcat 
became unresponsive, correct?)

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.



Re: tomcat hangs without anything

2010-03-11 Thread Maurice Mengel
I have changed server.xml to a ridiculous connectionTimeout value and now it
seems to run better. Since I did this for no good reason at all, it is
probably not the reason it runs better.
  Connector port=8080 protocol=HTTP/1.1
   connectionTimeout=2
   redirectPort=8443 /

Jconsole seems not to be able to connect, although servlet is responsive.

I think I probably need to read more about jconsole, but I guess I need to
sleep first.

For the time being it works now!

Thanks for the great help!

Your help makes tomcat a lot more sympathetic to me!

Maurice


On Thu, Mar 11, 2010 at 11:06 PM, Caldarale, Charles R 
chuck.caldar...@unisys.com wrote:

  From: Maurice Mengel [mailto:mauricemen...@gmail.com]
  Subject: Re: tomcat hangs without anything
 
  I hope this is what you ask me for:

 It is, and it shows nothing unusual - all pretty standard settings.

  Example: This time I was able to click 10 times on manager/status and
  list applications before it froze.

 What happens if you start another browser to connect to Tomcat with?

  I wrote a line in this email and then it didn't work anymore.

 How much memory do you have on the system?  Is it oversubscribed?

 Can you run JConsole and display what's going on inside the JVM Tomcat is
 using?  Might show heap exhaustion, although that would seem very unlikely
 based on the previously posted stack trace.  (Which was taken /after/ Tomcat
 became unresponsive, correct?)

  - Chuck


 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
 MATERIAL and is thus for use only by the intended recipient. If you received
 this in error, please contact the sender and delete the e-mail and its
 attachments from all computers.




RE: tomcat hangs without anything

2010-03-11 Thread Caldarale, Charles R
 From: Maurice Mengel [mailto:mauricemen...@gmail.com]
 Subject: Re: tomcat hangs without anything
 
   Connector port=8080 protocol=HTTP/1.1
connectionTimeout=2
redirectPort=8443 /

That time value only controls how long Tomcat will wait after a connection 
request to receive the first byte of data.  If raising it beyond the default of 
20 seconds helps, this is indicative of a client, not server, problem.  Are you 
perhaps running out of memory on the laptop, causing processes to get swapped 
out?

 Jconsole seems not to be able to connect

Odd; there are sometimes problems using JConsole with Tomcat running as a 
service, but I've not heard of any with Tomcat started with the scripts on XP.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.