0
votes

I have a Tomcat application running and for some reason one of my servlets is being put on hold while all the others respond while requests are being executed.

My connector config for Tomcat :

<Connector port="8008" protocol="HTTP/1.1"
maxThreads="50" minSpareThreads="5" maxSpareThreads="50"
    enableLookups="false" acceptCount="100"
           connectionTimeout="20000" 
           redirectPort="8443"
           compression="off"
           allowTrace="true"
compressionMinSize="128"
 noCompressionUserAgents="gozilla, traviata"
 compressableMimeType="text/html,text/xml,text/x-gwt-rpc; charset=utf-8,application/json; charset=utf-8,application/javascript" />

My GWT RPC servlet keeps responding while a very long request is being executed. But I created a servlet outside GWT (i.e. a plain old servlet) and when I send requests to this one, it will not respond until the long GWT request is over. It actually does not start executing at all (I added logs to see if it actually starts executing and it doesn't until the end of the log gwt request).

How can I debug the thread pool / inbounding request queue of Tomcat instance?

1
Are you using an IDE such as Eclipse or NetBeans? If so, you can start Tomcat with debugging turned on and then attach remotely and set breakpoints wherever you want. You'll need to have the Tomcat source also. How to set this up, if you have no experience with remote debugging, is probably beyond a SO answer, however. - Jim Garrison
Do a thread dump while the non-gwt servlet request is waiting to see what it is doing. - sourcedelica
Follow Jim Garrison's advice. That is the proper and usual way. Not a difficult thing to do. Jim should have put his comment as an answer and then you could choose it as the answer. - Blessed Geek

1 Answers

1
votes

Look at your IDE debug settings.

For example, on IntelliJ IDEA, you need to change Suspend policy to Thread in breakpoint settings. This means that only this thread which stopped for breakpoint will block and others will continue to run as normal.