Re: Tomcat does not shutdown properly and kill -3 does not work!

2008-08-06 Thread Maduranga Kannangara
Peter and all,

Earlier was from my MAC. This thread dump is from RedHat (production
server).

Your help is much appreciated.


Attaching to process ID 12649, please wait...
Debugger attached successfully.
Client compiler detected.
JVM version is 1.5.0_09-b01
Thread 12649: (state = BLOCKED)


Thread 17512: (state = IN_NATIVE)
Error occurred during stack walking:
sun.jvm.hotspot.debugger.DebuggerException:
sun.jvm.hotspot.debugger.DebuggerException: get_thread_regs failed for a lwp
at 
sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal$LinuxDebuggerLocalWorkerTh
read.execute(LinuxDebuggerLocal.java:134)
at 
sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.getThreadIntegerRegisterSe
t(LinuxDebuggerLocal.java:437)
at 
sun.jvm.hotspot.debugger.linux.LinuxThread.getContext(LinuxThread.java:48)
at 
sun.jvm.hotspot.runtime.linux_x86.LinuxX86JavaThreadPDAccess.getCurrentFrame
Guess(LinuxX86JavaThreadPDAccess.java:75)
at 
sun.jvm.hotspot.runtime.JavaThread.getCurrentFrameGuess(JavaThread.java:252)
at 
sun.jvm.hotspot.runtime.JavaThread.getLastJavaVFrameDbg(JavaThread.java:211)
at sun.jvm.hotspot.tools.StackTrace.run(StackTrace.java:50)
at sun.jvm.hotspot.tools.JStack.run(JStack.java:41)
at sun.jvm.hotspot.tools.Tool.start(Tool.java:204)
at sun.jvm.hotspot.tools.JStack.main(JStack.java:58)
Caused by: sun.jvm.hotspot.debugger.DebuggerException: get_thread_regs
failed for a lwp
at 
sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.getThreadIntegerRegisterSe
t0(Native Method)
at 
sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.access$800(LinuxDebuggerLo
cal.java:34)
at 
sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal$1GetThreadIntegerRegisterS
etTask.doit(LinuxDebuggerLocal.java:431)
at 
sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal$LinuxDebuggerLocalWorkerTh
read.run(LinuxDebuggerLocal.java:109)


Thread 17507: (state = IN_NATIVE)
Error occurred during stack walking:
sun.jvm.hotspot.debugger.DebuggerException:
sun.jvm.hotspot.debugger.DebuggerException: get_thread_regs failed for a lwp
at 
sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal$LinuxDebuggerLocalWorkerTh
read.execute(LinuxDebuggerLocal.java:134)
at 
sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.getThreadIntegerRegisterSe
t(LinuxDebuggerLocal.java:437)
at 
sun.jvm.hotspot.debugger.linux.LinuxThread.getContext(LinuxThread.java:48)
at 
sun.jvm.hotspot.runtime.linux_x86.LinuxX86JavaThreadPDAccess.getCurrentFrame
Guess(LinuxX86JavaThreadPDAccess.java:75)
at 
sun.jvm.hotspot.runtime.JavaThread.getCurrentFrameGuess(JavaThread.java:252)
at 
sun.jvm.hotspot.runtime.JavaThread.getLastJavaVFrameDbg(JavaThread.java:211)
at sun.jvm.hotspot.tools.StackTrace.run(StackTrace.java:50)
at sun.jvm.hotspot.tools.JStack.run(JStack.java:41)
at sun.jvm.hotspot.tools.Tool.start(Tool.java:204)
at sun.jvm.hotspot.tools.JStack.main(JStack.java:58)
Caused by: sun.jvm.hotspot.debugger.DebuggerException: get_thread_regs
failed for a lwp
at 
sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.getThreadIntegerRegisterSe
t0(Native Method)
at 
sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.access$800(LinuxDebuggerLo
cal.java:34)
at 
sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal$1GetThreadIntegerRegisterS
etTask.doit(LinuxDebuggerLocal.java:431)
at 
sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal$LinuxDebuggerLocalWorkerTh
read.run(LinuxDebuggerLocal.java:109)


Thread 16161: (state = IN_NATIVE)
Error occurred during stack walking:
sun.jvm.hotspot.debugger.DebuggerException:
sun.jvm.hotspot.debugger.DebuggerException: get_thread_regs failed for a lwp
at 
sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal$LinuxDebuggerLocalWorkerTh
read.execute(LinuxDebuggerLocal.java:134)
at 
sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.getThreadIntegerRegisterSe
t(LinuxDebuggerLocal.java:437)
at 
sun.jvm.hotspot.debugger.linux.LinuxThread.getContext(LinuxThread.java:48)
at 
sun.jvm.hotspot.runtime.linux_x86.LinuxX86JavaThreadPDAccess.getCurrentFrame
Guess(LinuxX86JavaThreadPDAccess.java:75)
at 
sun.jvm.hotspot.runtime.JavaThread.getCurrentFrameGuess(JavaThread.java:252)
at 
sun.jvm.hotspot.runtime.JavaThread.getLastJavaVFrameDbg(JavaThread.java:211)
at sun.jvm.hotspot.tools.StackTrace.run(StackTrace.java:50)
at sun.jvm.hotspot.tools.JStack.run(JStack.java:41)
at sun.jvm.hotspot.tools.Tool.start(Tool.java:204)
at sun.jvm.hotspot.tools.JStack.main(JStack.java:58)
Caused by: sun.jvm.hotspot.debugger.DebuggerException: get_thread_regs
failed for a lwp
at 
sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.getThreadIntegerRegisterSe
t0(Native Method)
at 
sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.access$800(LinuxDebuggerLo
cal.java:34)
at 

RE: Tomcat does not shutdown properly and kill -3 does not work!

2008-08-06 Thread Peter Crowther
 From: Maduranga Kannangara [mailto:[EMAIL PROTECTED]
 Below is my dump and thanks a lot for your time.
[...]
 Thread [EMAIL PROTECTED]: (state = BLOCKED)
  - java.lang.Thread.sleep(long) @bci=0 (Interpreted frame)
  - org.quartz.core.QuartzSchedulerThread.run() @bci=870, line=420
 (Interpreted frame)
[...]
 Thread [EMAIL PROTECTED]: (state = BLOCKED)
  - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
  - org.quartz.simpl.SimpleThreadPool$WorkerThread.run()
 @bci=44, line=523
 (Interpreted frame)

Ah.  Quartz is used in your webapp!  It's a known problem.

I assume you've tried following the instructions at 
http://jira.springframework.org/browse/INT-147 and used 
destroy-method=shutdown in the bean config?  If not, try that and see what 
happens.

- Peter

-
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 does not shutdown properly and kill -3 does not work!

2008-08-06 Thread Maduranga Kannangara
Hi,

A friend of mine said it was not due to ActiveMQ that Tomcat does not
shutdown properly, however I added a kill command to shutdown.sh script
which is NOT good at all, I understand.

In MAC (10.5) kill -3 seems working, but its a blind path which gets me
nowhere. I do not get a trace of the threads. Its a wrong path I am
following. What I need simply is a clean shutdown on Tomcat :-)

Environment:
Tomcat: 5.5.20
JVM: 1.5.0_09-b01
OS: Red Hat Enterprise Linux AS release 4 (Nahant Update 2)

Please help! :-)

Thanks again
Maduranga




On 5/8/08 10:59, Maduranga Kannangara [EMAIL PROTECTED] wrote:

 Hello,
 
 There is an issue with my Tomcat instance where I have to kill it using ­9
 all the time.
 
 This is my application environment:
 An active-mq queue is used inside my application war.
 Tomcat version: 5.x
 OS: Redhat Linux
 
 However I was unable to get trace using kill ­3 as I saw in some of the
 threads in this mailing list.
 
 How can I ensure proper shutdown of Tomcat?
 
 Thanks in advance!
 Maduranga
 


-- 
Koodos - stylish brads, smart prices
http://www.koodos.com



-
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 does not shutdown properly and kill -3 does not work!

2008-08-06 Thread Peter Crowther
 From: Maduranga Kannangara [mailto:[EMAIL PROTECTED]
 What I need simply is a clean shutdown on Tomcat :-)

Yes.  In order to *get* that clean shutdown, you need to find out what's 
preventing it :-).

One common problem is that something in your webapp has created a thread and 
not marked it as a daemon thread 
(http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#setDaemon(boolean)
 - yes, I know that's probably for the wrong Java version, but the problem 
still stands).  The JVM won't exit while that thread's still alive, so the 
notion of trying to shut down Tomcat then getting a thread dump after that 
point is a very good one.

Hmm.  You're on a 1.5 JDK on Linux.  That means you should be able to use 
jstack to get a thread dump - might be worth a try.  I don't think we can help 
you much more on this list until we have some idea of what's keeping the JVM 
running!

- Peter

-
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 does not shutdown properly and kill -3 does not work!

2008-08-06 Thread Maduranga Kannangara
Thanks a lot Peter! I got a thread dump using jstack 704 (PID was 704)
I think I need a little more of your help to find out where exactly going
wrong. Below is my dump and thanks a lot for your time.

MadurangaMAC:bin Maduranga$ jstack 704
Attaching to process ID 704, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 1.5.0_13-119
Thread [EMAIL PROTECTED]: (state = BLOCKED)


Thread [EMAIL PROTECTED]: (state = BLOCKED)
 - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
 - java.lang.Object.wait() @bci=2, line=474 (Interpreted frame)
 - org.apache.jk.common.ChannelSocket.accept(org.apache.jk.core.MsgContext)
@bci=20, line=306 (Interpreted frame)
 - org.apache.jk.common.ChannelSocket.acceptConnections() @bci=72, line=666
(Interpreted frame)
 - 
org.apache.jk.common.ChannelSocket$SocketAcceptor.runIt(java.lang.Object[])
@bci=4, line=876 (Interpreted frame)
 - org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run() @bci=167,
line=689 (Interpreted frame)
 - java.lang.Thread.run() @bci=11, line=613 (Interpreted frame)


Thread [EMAIL PROTECTED]: (state = BLOCKED)
 - java.lang.Thread.sleep(long) @bci=0 (Interpreted frame)
 - 
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(java.lang.Object
[]) @bci=23, line=62 (Interpreted frame)
 - org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run() @bci=167,
line=689 (Interpreted frame)
 - java.lang.Thread.run() @bci=11, line=613 (Interpreted frame)


Thread [EMAIL PROTECTED]: (state = BLOCKED)
 - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
 - java.util.TimerThread.mainLoop() @bci=201, line=509 (Interpreted frame)
 - java.util.TimerThread.run() @bci=1, line=462 (Interpreted frame)


Thread [EMAIL PROTECTED]: (state = BLOCKED)
 - java.lang.Thread.sleep(long) @bci=0 (Interpreted frame)
 - org.quartz.core.QuartzSchedulerThread.run() @bci=870, line=420
(Interpreted frame)


Thread [EMAIL PROTECTED]: (state = BLOCKED)
 - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
 - org.quartz.simpl.SimpleThreadPool$WorkerThread.run() @bci=44, line=523
(Interpreted frame)


Thread [EMAIL PROTECTED]: (state = BLOCKED)
 - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
 - org.quartz.simpl.SimpleThreadPool$WorkerThread.run() @bci=44, line=523
(Interpreted frame)


Thread [EMAIL PROTECTED]: (state = BLOCKED)
 - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
 - org.quartz.simpl.SimpleThreadPool$WorkerThread.run() @bci=44, line=523
(Interpreted frame)


Thread [EMAIL PROTECTED]: (state = BLOCKED)
 - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
 - org.quartz.simpl.SimpleThreadPool$WorkerThread.run() @bci=44, line=523
(Interpreted frame)


Thread [EMAIL PROTECTED]: (state = BLOCKED)
 - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
 - org.quartz.simpl.SimpleThreadPool$WorkerThread.run() @bci=44, line=523
(Interpreted frame)


Thread [EMAIL PROTECTED]: (state = BLOCKED)
 - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
 - org.quartz.simpl.SimpleThreadPool$WorkerThread.run() @bci=44, line=523
(Interpreted frame)


Thread [EMAIL PROTECTED]: (state = BLOCKED)
 - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
 - org.quartz.simpl.SimpleThreadPool$WorkerThread.run() @bci=44, line=523
(Interpreted frame)


Thread [EMAIL PROTECTED]: (state = BLOCKED)
 - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
 - org.quartz.simpl.SimpleThreadPool$WorkerThread.run() @bci=44, line=523
(Interpreted frame)


Thread [EMAIL PROTECTED]: (state = BLOCKED)
 - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
 - org.quartz.simpl.SimpleThreadPool$WorkerThread.run() @bci=44, line=523
(Interpreted frame)


Thread [EMAIL PROTECTED]: (state = BLOCKED)
 - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
 - org.quartz.simpl.SimpleThreadPool$WorkerThread.run() @bci=44, line=523
(Interpreted frame)


Thread [EMAIL PROTECTED]: (state = BLOCKED)


Thread [EMAIL PROTECTED]: (state = BLOCKED)
 - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
 - java.lang.ref.ReferenceQueue.remove(long) @bci=44, line=116 (Interpreted
frame)
 - java.lang.ref.ReferenceQueue.remove() @bci=2, line=132 (Interpreted
frame)
 - java.lang.ref.Finalizer$FinalizerThread.run() @bci=3, line=159
(Interpreted frame)


Thread [EMAIL PROTECTED]: (state = BLOCKED)
 - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
 - java.lang.Object.wait() @bci=2, line=474 (Interpreted frame)
 - java.lang.ref.Reference$ReferenceHandler.run() @bci=46, line=116
(Interpreted frame)


Thanks again
Muds


On 6/8/08 11:27, Peter Crowther [EMAIL PROTECTED] wrote:

 From: Maduranga Kannangara [mailto:[EMAIL PROTECTED]
 What I need simply is a clean shutdown on Tomcat :-)
 
 Yes.  In order to *get* that clean shutdown, you need to find out what's
 preventing it :-).
 
 One common problem is that something in your webapp has created a thread and
 not marked it as a daemon thread
 

RE: Tomcat does not shutdown properly and kill -3 does not work!

2008-08-05 Thread Peter Crowther
 From: Maduranga Kannangara [mailto:[EMAIL PROTECTED]
 There is an issue with my Tomcat instance where I have to
 kill it using 9 all the time.

 This is my application environment:
 An active-mq queue is used inside my application war.
 Tomcat version: 5.x
 OS: Redhat Linux

It would help if you were more specific with your versions - Tomcat 5.0.x and 
5.5.x are significantly different, and RedHat has put out a *lot* of Linux 
versions over the years.

 However I was unable to get trace using kill 3 as I saw in
 some of the threads in this mailing list.

 How can I ensure proper shutdown of Tomcat?

What JVM are you using?  In particular, I don't think the GNU JVM that comes 
with some versions of RedHat supports giving a thread dump on kill -QUIT.

- Peter

-
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 does not shutdown properly and kill -3 does not work!

2008-08-05 Thread Maduranga Kannangara
Tomcat: 5.5.20
JVM: Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_09-b01)
OS: Red Hat Enterprise Linux AS release 4 (Nahant Update 2)

However, this also same behavior on OSX 10.5 as well.
With JVM: Java(TM) 2 Runtime Environment, Standard Edition (build
1.5.0_13-b05-237)

I need more of a tracing mechanism at the moment, as the good kill -3 seem
no good with my environment :-(

Thanks


On 5/8/08 11:21, Peter Crowther [EMAIL PROTECTED] wrote:

 From: Maduranga Kannangara [mailto:[EMAIL PROTECTED]
 There is an issue with my Tomcat instance where I have to
 kill it using 9 all the time.
 
 This is my application environment:
 An active-mq queue is used inside my application war.
 Tomcat version: 5.x
 OS: Redhat Linux
 
 It would help if you were more specific with your versions - Tomcat 5.0.x and
 5.5.x are significantly different, and RedHat has put out a *lot* of Linux
 versions over the years.
 
 However I was unable to get trace using kill 3 as I saw in
 some of the threads in this mailing list.
 
 How can I ensure proper shutdown of Tomcat?
 
 What JVM are you using?  In particular, I don't think the GNU JVM that comes
 with some versions of RedHat supports giving a thread dump on kill -QUIT.
 
 - Peter
 
 -
 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]