0 Replies Latest reply on Sep 23, 2003 11:58 AM by jcrosbie

    Remote MBean notification client hangs on shutdown

    jcrosbie

      It seemed more appropriate to create a separate thread to discuss the client side.

      I have a remote Swing client that is registering for MBean notifications using the JBoss remote API. When the client application shuts down normally, a thread is still waiting on something and I can't figure out how to kill it, other than Ctrl+C. If I don't register with the MBean server, this problem goes away so I am guessing an RMI thread is hanging around. Here is the thread dump after the application has been closed by the user:

      Full thread dump Java HotSpot(TM) Client VM (1.4.2-b28 mixed mode):

      "Thread-3" daemon prio=1 tid=0x4db4a6f8 nid=0x200f runnable [4dd82000..4dd828c8]
      at java.io.FileInputStream.readBytes(Native Method)
      at java.io.FileInputStream.read(FileInputStream.java:177)
      at org.apache.tools.ant.taskdefs.StreamPumper.run(StreamPumper.java:105)
      at java.lang.Thread.run(Thread.java:534)

      "Thread-2" daemon prio=1 tid=0x4db4a060 nid=0x200e runnable [4dd01000..4dd018c8]
      at java.io.FileInputStream.readBytes(Native Method)
      at java.io.FileInputStream.read(FileInputStream.java:194)
      at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
      at java.io.BufferedInputStream.read1(BufferedInputStream.java:222)
      at java.io.BufferedInputStream.read(BufferedInputStream.java:277)
      - locked <0x44830e30> (a java.io.BufferedInputStream)
      at java.io.FilterInputStream.read(FilterInputStream.java:90)
      at org.apache.tools.ant.taskdefs.StreamPumper.run(StreamPumper.java:105)
      at java.lang.Thread.run(Thread.java:534)

      "process reaper" daemon prio=1 tid=0x4db1d6b0 nid=0x200c runnable [4dc80000..4dc808c8]
      at java.lang.UNIXProcess.waitForProcessExit(Native Method)
      at java.lang.UNIXProcess.access$1500(UNIXProcess.java:20)
      at java.lang.UNIXProcess$2.run(UNIXProcess.java:127)

      "Signal Dispatcher" daemon prio=1 tid=0x0808fbf0 nid=0x2009 waiting on condition [0..0]

      "Finalizer" daemon prio=1 tid=0x0808a6e0 nid=0x2007 in Object.wait() [4c912000..4c9128c8]
      at java.lang.Object.wait(Native Method)
      - waiting on <0x44bf94b0> (a java.lang.ref.ReferenceQueue$Lock)
      at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
      - locked <0x44bf94b0> (a java.lang.ref.ReferenceQueue$Lock)
      at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
      at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)

      "Reference Handler" daemon prio=1 tid=0x08089a70 nid=0x2006 in Object.wait() [4c891000..4c8918c8]
      at java.lang.Object.wait(Native Method)
      - waiting on <0x44bf9518> (a java.lang.ref.Reference$Lock)
      at java.lang.Object.wait(Object.java:429)
      at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:115)
      - locked <0x44bf9518> (a java.lang.ref.Reference$Lock)

      "main" prio=1 tid=0x08052290 nid=0x2003 in Object.wait() [bfffc000..bfffd038]
      at java.lang.Object.wait(Native Method)
      - waiting on <0x44830350> (a java.lang.UNIXProcess)
      at java.lang.Object.wait(Object.java:429)
      at java.lang.UNIXProcess.waitFor(UNIXProcess.java:160)
      - locked <0x44830350> (a java.lang.UNIXProcess)
      at org.apache.tools.ant.taskdefs.Execute.waitFor(Execute.java:466)
      at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:448)
      at org.apache.tools.ant.taskdefs.Java.run(Java.java:488)
      at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:160)
      at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
      at org.apache.tools.ant.Task.perform(Task.java:341)
      at org.apache.tools.ant.Target.execute(Target.java:309)
      at org.apache.tools.ant.Target.performTasks(Target.java:336)
      at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
      at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
      at org.apache.tools.ant.Main.runBuild(Main.java:609)
      at org.apache.tools.ant.Main.start(Main.java:196)
      at org.apache.tools.ant.Main.main(Main.java:235)

      "VM Thread" prio=1 tid=0x08086860 nid=0x2005 runnable

      "VM Periodic Task Thread" prio=1 tid=0x08092310 nid=0x200b waiting on condition
      "Suspend Checker Thread" prio=1 tid=0x0808f1b8 nid=0x2008 runnable
      [java] Full thread dump Java HotSpot(TM) Client VM (1.4.2-b28 mixed mode):

      [java] "TimerQueue" daemon prio=1 tid=0x0844c028 nid=0x2047 in Object.wait() [4f60d000..4f60d8c8]
      [java] at java.lang.Object.wait(Native Method)
      [java] - waiting on <0x44dbcb10> (a javax.swing.TimerQueue)
      [java] at javax.swing.TimerQueue.run(TimerQueue.java:231)
      [java] - locked <0x44dbcb10> (a javax.swing.TimerQueue)
      [java] at java.lang.Thread.run(Thread.java:534)

      [java] "DestroyJavaVM" prio=1 tid=0x4ee4ea00 nid=0x200d waiting on condition [0..bfffc694]

      [java] "RMI LeaseChecker" daemon prio=1 tid=0x08423f60 nid=0x2046 waiting on condition [4f58c000..4f58c8c8]
      [java] at java.lang.Thread.sleep(Native Method)
      [java] at sun.rmi.transport.DGCImpl$LeaseChecker.run(DGCImpl.java:307)
      [java] at java.lang.Thread.run(Thread.java:534)

      [java] "RMI TCP Connection(1)-172.30.250.71" daemon prio=1 tid=0x084151b0 nid=0x2045 runnable [4f50b000..4f50b8c8]
      [java] at java.net.SocketInputStream.socketRead0(Native Method)
      [java] at java.net.SocketInputStream.read(SocketInputStream.java:129)
      [java] at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
      [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
      [java] - locked <0x44dafa58> (a java.io.BufferedInputStream)
      [java] at java.io.FilterInputStream.read(FilterInputStream.java:66)
      [java] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:442)
      [java] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      [java] at java.lang.Thread.run(Thread.java:534)

      [java] "RMI Reaper" prio=1 tid=0x4ee15948 nid=0x2044 in Object.wait() [4f48a000..4f48a8c8]
      [java] at java.lang.Object.wait(Native Method)
      [java] - waiting on <0x44dafc00> (a java.lang.ref.ReferenceQueue$Lock)
      [java] at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
      [java] - locked <0x44dafc00> (a java.lang.ref.ReferenceQueue$Lock)
      [java] at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
      [java] at sun.rmi.transport.ObjectTable$Reaper.run(ObjectTable.java:330)
      [java] at java.lang.Thread.run(Thread.java:534)

      [java] "Thread-14" daemon prio=1 tid=0x4ee157e8 nid=0x2043 in Object.wait() [4f409000..4f4098c8]
      [java] at java.lang.Object.wait(Native Method)
      [java] - waiting on <0x44dafc78> (a java.util.TaskQueue)
      [java] at java.lang.Object.wait(Object.java:429)
      [java] at java.util.TimerThread.mainLoop(Timer.java:403)
      [java] - locked <0x44dafc78> (a java.util.TaskQueue)
      [java] at java.util.TimerThread.run(Timer.java:382)

      [java] "RMI TCP Accept-0" daemon prio=1 tid=0x4ee01558 nid=0x2042 runnable [4eddd000..4eddd8c8]
      [java] at java.net.PlainSocketImpl.socketAccept(Native Method)
      [java] at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:353)
      [java] - locked <0x44dafce0> (a java.net.PlainSocketImpl)
      [java] at java.net.ServerSocket.implAccept(ServerSocket.java:448)
      [java] at java.net.ServerSocket.accept(ServerSocket.java:419)
      [java] at sun.rmi.transport.tcp.TCPTransport.run(TCPTransport.java:334)
      [java] at java.lang.Thread.run(Thread.java:534)

      [java] "Java2D Disposer" daemon prio=1 tid=0x0842c3b0 nid=0x203f in Object.wait() [4f286000..4f2868c8]
      [java] at java.lang.Object.wait(Native Method)
      [java] - waiting on <0x44d90f30> (a java.lang.ref.ReferenceQueue$Lock)
      [java] at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
      [java] - locked <0x44d90f30> (a java.lang.ref.ReferenceQueue$Lock)
      [java] at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
      [java] at sun.java2d.Disposer.run(Disposer.java:100)
      [java] at java.lang.Thread.run(Thread.java:534)

      [java] "RMI ConnectionExpiration-[172.30.250.71:44480]" daemon prio=1 tid=0x4ee012d8 nid=0x203a waiting on condition [4f103000..4f1038c8]
      [java] at java.lang.Thread.sleep(Native Method)
      [java] at sun.rmi.transport.tcp.TCPChannel$Reaper.run(TCPChannel.java:447)
      [java] at java.lang.Thread.run(Thread.java:534)

      [java] "RMI RenewClean-[172.30.250.71:44480]" daemon prio=1 tid=0x4ee00550 nid=0x2038 in Object.wait() [4f001000..4f0018c8]
      [java] at java.lang.Object.wait(Native Method)
      [java] - waiting on <0x44d5a458> (a java.lang.ref.ReferenceQueue$Lock)
      [java] at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
      [java] - locked <0x44d5a458> (a java.lang.ref.ReferenceQueue$Lock)
      [java] at sun.rmi.transport.DGCClient$EndpointEntry$RenewCleanThread.run(DGCClient.java:500)
      [java] at java.lang.Thread.run(Thread.java:534)

      [java] "RMI ConnectionExpiration-[172.30.250.71:44479]" daemon prio=1 tid=0x4ee01fb8 nid=0x2037 waiting on condition [4ef80000..4ef808c8]
      [java] at java.lang.Thread.sleep(Native Method)
      [java] at sun.rmi.transport.tcp.TCPChannel$Reaper.run(TCPChannel.java:447)
      [java] at java.lang.Thread.run(Thread.java:534)

      [java] "RMI ConnectionExpiration-[127.0.0.1:34559]" daemon prio=1 tid=0x081cb8d0 nid=0x2021 waiting on condition [4e4c6000..4e4c68c8]
      [java] at java.lang.Thread.sleep(Native Method)
      [java] at sun.rmi.transport.tcp.TCPChannel$Reaper.run(TCPChannel.java:447)
      [java] at java.lang.Thread.run(Thread.java:534)

      [java] "RMI RenewClean-[127.0.0.1:34559]" daemon prio=1 tid=0x081ca990 nid=0x201f in Object.wait() [4e445000..4e4458c8]
      [java] at java.lang.Object.wait(Native Method)
      [java] - waiting on <0x44ca8ad8> (a java.lang.ref.ReferenceQueue$Lock)
      [java] at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
      [java] - locked <0x44ca8ad8> (a java.lang.ref.ReferenceQueue$Lock)
      [java] at sun.rmi.transport.DGCClient$EndpointEntry$RenewCleanThread.run(DGCClient.java:500)
      [java] at java.lang.Thread.run(Thread.java:534)

      [java] "RMI ConnectionExpiration-[172.30.250.71:44479]" daemon prio=1 tid=0x081c1c68 nid=0x201e waiting on condition [4e3c4000..4e3c48c8]
      [java] at java.lang.Thread.sleep(Native Method)
      [java] at sun.rmi.transport.tcp.TCPChannel$Reaper.run(TCPChannel.java:447)
      [java] at java.lang.Thread.run(Thread.java:534)

      [java] "GC Daemon" daemon prio=1 tid=0x0839b218 nid=0x201d in Object.wait() [4e343000..4e3438c8]
      [java] at java.lang.Object.wait(Native Method)
      [java] - waiting on <0x44c9d0f0> (a sun.misc.GC$LatencyLock)
      [java] at sun.misc.GC$Daemon.run(GC.java:100)
      [java] - locked <0x44c9d0f0> (a sun.misc.GC$LatencyLock)

      [java] "AWT-Motif" daemon prio=1 tid=0x0833e728 nid=0x2019 runnable [4e1af000..4e1af8c8]
      [java] at sun.awt.motif.MToolkit.run(Native Method)
      [java] at java.lang.Thread.run(Thread.java:534)

      [java] "Signal Dispatcher" daemon prio=1 tid=0x08090190 nid=0x2015 waiting on condition [0..0]

      [java] "Finalizer" daemon prio=1 tid=0x0808ad68 nid=0x2013 in Object.wait() [4c912000..4c9128c8]
      [java] at java.lang.Object.wait(Native Method)
      [java] - waiting on <0x44c04168> (a java.lang.ref.ReferenceQueue$Lock)
      [java] at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
      [java] - locked <0x44c04168> (a java.lang.ref.ReferenceQueue$Lock)
      [java] at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
      [java] at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)

      [java] "Reference Handler" daemon prio=1 tid=0x0808a0f8 nid=0x2012 in Object.wait() [4c891000..4c8918c8]
      [java] at java.lang.Object.wait(Native Method)
      [java] - waiting on <0x44c041d0> (a java.lang.ref.Reference$Lock)
      [java] at java.lang.Object.wait(Object.java:429)
      [java] at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:115)
      [java] - locked <0x44c041d0> (a java.lang.ref.Reference$Lock)

      [java] "VM Thread" prio=1 tid=0x08086ee8 nid=0x2011 runnable

      [java] "VM Periodic Task Thread" prio=1 tid=0x080928b0 nid=0x2017 waiting on condition
      [java] "Suspend Checker Thread" prio=1 tid=0x0808f758 nid=0x2014 runnable