10 Replies Latest reply on Feb 27, 2012 12:25 PM by dlofthouse

    JBossAS7 [thunder] document misleading need correction

    robertobeeman

      Hi,

       

             https://docs.jboss.org/author/display/AS71/Subsystem+configuration

       

             Above link has a section which tells us how to remotely connect to JConsole using JMX but the Tags seems totally changed in "Thunder"

       

      The JMX subsystem sets up a JMX connector so that invocations can be done on the JMX MBean server from outside the JVM

      <subsystem xmlns="urn:jboss:domain:jmx:1.0">

       

          <jmx-connector registry-binding="jmx-connector-registry"

              server-binding="jmx-connector-server"/>

      </subsystem>

      ...

      <socket-binding-group name="standard-sockets" default-interface="public">

          ...

          <socket-binding name="jmx-connector-registry" port="1090"/>

          <socket-binding name="jmx-connector-server" port="1091"/>

          ...

      </socket-binding-group>

      To use the connector you can access it in the standard way:

      import javax.management.MBeanServerConnection;

      import javax.management.remote.JMXConnector;

      import javax.management.remote.JMXConnectorFactory;

      import javax.management.remote.JMXServiceURL;

       

      public class JMXExample {

       

          public static void main(String[] args) throws Exception {

              //Get a connection to the JBoss AS MBean server on localhost

              String host = "localhost";

              int port = 9999;

              String urlString =

                  System.getProperty("jmx.service.url","service:jmx:remoting-jmx://" + host + ":" + port);

              JMXServiceURL serviceURL = new JMXServiceURL(urlString);

              JMXConnector jmxConnector = JMXConnectorFactory.connect(serviceURL, null);

              MBeanServerConnection connection = jmxConnector.getMBeanServerConnection();

       

              //Invoke on the JBoss AS MBean server

              int count = connection.getMBeanCount();

              System.out.println(count);

          }

      }

        • 1. Re: JBossAS7 [thunder] document misleading need correction
          smarlow

          Looks like the top section of that page is also out of date, just updated it. 

          1 of 1 people found this helpful
          • 2. Re: JBossAS7 [thunder] document misleading need correction
            robertobeeman

            Hi Scott,

             

                       The above program works fine.   But it never gets terminated.   I am using "Thunder".   The program just hangs after the execution of the last statement   "System.out.println(count);"

             

            Even when i am trying to close the jmxConnection like following:

             

             

                    int count = connection.getMBeanCount();

                    System.out.println(count);

                    jmxConnector.close();

             

             

            Thanks

            • 3. Re: JBossAS7 [thunder] document misleading need correction
              smarlow

              Hmm, I thought I hit that and fixed it.  I'll check my local copy of the test...

              1 of 1 people found this helpful
              • 4. Re: JBossAS7 [thunder] document misleading need correction
                smarlow

                I had added the close call locally to address that (its in the doc now also).  Could you try once more and capture a thread dump (use "jps -l" to get the process id and pass that to "jstack processId").

                • 5. Re: JBossAS7 [thunder] document misleading need correction
                  robertobeeman

                  Hi Scott,

                   

                              Here is the Thread Dump:

                   

                   

                  jstack -l 13583

                  2012-02-24 01:08:22

                  Full thread dump Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode):

                   

                   

                  "Attach Listener" daemon prio=10 tid=0x00007fc9bc001000 nid=0x357c waiting on condition [0x0000000000000000]

                     java.lang.Thread.State: RUNNABLE

                   

                   

                     Locked ownable synchronizers:

                            - None

                   

                   

                  "DestroyJavaVM" prio=10 tid=0x00007fca281b2000 nid=0x3510 waiting on condition [0x0000000000000000]

                     java.lang.Thread.State: RUNNABLE

                   

                   

                     Locked ownable synchronizers:

                            - None

                   

                   

                  "pool-1-thread-1" prio=10 tid=0x00007fc9a0002800 nid=0x3524 waiting on condition [0x00007fc9e45d7000]

                     java.lang.Thread.State: TIMED_WAITING (parking)

                            at sun.misc.Unsafe.park(Native Method)

                            - parking to wait for  <0x00007fca11cfa2a8> (a java.util.concurrent.SynchronousQueue$TransferStack)

                            at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198)

                            at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:424)

                            at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:323)

                            at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:874)

                            at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:945)

                            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)

                            at java.lang.Thread.run(Thread.java:619)

                   

                   

                     Locked ownable synchronizers:

                            - None

                   

                   

                  "Low Memory Detector" daemon prio=10 tid=0x00007fca28090000 nid=0x351b runnable [0x0000000000000000]

                     java.lang.Thread.State: RUNNABLE

                   

                   

                     Locked ownable synchronizers:

                            - None

                   

                   

                  "CompilerThread1" daemon prio=10 tid=0x00007fca2808d800 nid=0x351a waiting on condition [0x0000000000000000]

                     java.lang.Thread.State: RUNNABLE

                   

                   

                     Locked ownable synchronizers:

                            - None

                   

                   

                  "CompilerThread0" daemon prio=10 tid=0x00007fca2808b000 nid=0x3519 waiting on condition [0x0000000000000000]

                     java.lang.Thread.State: RUNNABLE

                   

                   

                     Locked ownable synchronizers:

                            - None

                   

                   

                  "Signal Dispatcher" daemon prio=10 tid=0x00007fca28089000 nid=0x3518 runnable [0x0000000000000000]

                     java.lang.Thread.State: RUNNABLE

                   

                   

                     Locked ownable synchronizers:

                            - None

                   

                   

                  "Finalizer" daemon prio=10 tid=0x00007fca2806a800 nid=0x3517 in Object.wait() [0x00007fca2c4ca000]

                     java.lang.Thread.State: WAITING (on object monitor)

                            at java.lang.Object.wait(Native Method)

                            - waiting on <0x00007fca1371c310> (a java.lang.ref.ReferenceQueue$Lock)

                            at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)

                            - locked <0x00007fca1371c310> (a java.lang.ref.ReferenceQueue$Lock)

                            at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)

                            at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)

                   

                   

                     Locked ownable synchronizers:

                            - None

                   

                   

                  "Reference Handler" daemon prio=10 tid=0x00007fca28068800 nid=0x3516 in Object.wait() [0x00007fca2c5cb000]

                     java.lang.Thread.State: WAITING (on object monitor)

                            at java.lang.Object.wait(Native Method)

                            - waiting on <0x00007fca1370c180> (a java.lang.ref.Reference$Lock)

                            at java.lang.Object.wait(Object.java:485)

                            at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)

                            - locked <0x00007fca1370c180> (a java.lang.ref.Reference$Lock)

                   

                   

                     Locked ownable synchronizers:

                            - None

                   

                   

                  "VM Thread" prio=10 tid=0x00007fca28064000 nid=0x3515 runnable

                   

                   

                  "GC task thread#0 (ParallelGC)" prio=10 tid=0x00007fca2801a000 nid=0x3511 runnable

                   

                   

                  "GC task thread#1 (ParallelGC)" prio=10 tid=0x00007fca2801b800 nid=0x3512 runnable

                   

                   

                  "GC task thread#2 (ParallelGC)" prio=10 tid=0x00007fca2801d800 nid=0x3513 runnable

                   

                   

                  "GC task thread#3 (ParallelGC)" prio=10 tid=0x00007fca2801f800 nid=0x3514 runnable

                   

                   

                  "VM Periodic Task Thread" prio=10 tid=0x00007fca280a2800 nid=0x351c waiting on condition

                   

                   

                  JNI global references: 930

                  • 6. Re: JBossAS7 [thunder] document misleading need correction
                    robertobeeman

                    Following Thread Dump Shows the Isssue:

                     

                    java JMXExample

                     

                    Feb 24, 2012 1:09:53 AM org.xnio.Xnio <clinit>

                    INFO: XNIO Version 3.0.3.GA

                    Feb 24, 2012 1:09:53 AM org.xnio.nio.NioXnio <clinit>

                    INFO: XNIO NIO Implementation Version 3.0.3.GA

                    Feb 24, 2012 1:09:53 AM org.jboss.remoting3.EndpointImpl <clinit>

                    INFO: JBoss Remoting version 3.2.2.GA

                    240

                     

                     

                     

                    jstack -l 13765

                    2012-02-24 01:16:48

                    Full thread dump Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode):

                     

                     

                    "Attach Listener" daemon prio=10 tid=0x00007fdfcc001000 nid=0x35fd waiting on condition [0x0000000000000000]

                       java.lang.Thread.State: RUNNABLE

                     

                     

                       Locked ownable synchronizers:

                              - None

                     

                     

                    "DestroyJavaVM" prio=10 tid=0x00007fe038007000 nid=0x35c6 waiting on condition [0x0000000000000000]

                       java.lang.Thread.State: RUNNABLE

                     

                     

                       Locked ownable synchronizers:

                              - None

                     

                     

                    "Remoting "endpoint" task-4" prio=10 tid=0x00007fe0381e2800 nid=0x35d8 waiting on condition [0x00007fdff41d3000]

                       java.lang.Thread.State: WAITING (parking)

                              at sun.misc.Unsafe.park(Native Method)

                              - parking to wait for  <0x00007fe0236e5490> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)

                              at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)

                              at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)

                              at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)

                              at org.xnio.LimitedBlockingQueue.take(LimitedBlockingQueue.java:95)

                              at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)

                              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)

                              at java.lang.Thread.run(Thread.java:619)

                     

                     

                       Locked ownable synchronizers:

                              - None

                     

                     

                    "Remoting "endpoint" task-3" prio=10 tid=0x00007fdfb4055000 nid=0x35d7 waiting on condition [0x00007fdff42d4000]

                       java.lang.Thread.State: WAITING (parking)

                              at sun.misc.Unsafe.park(Native Method)

                              - parking to wait for  <0x00007fe0236e5490> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)

                              at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)

                              at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)

                              at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)

                              at org.xnio.LimitedBlockingQueue.take(LimitedBlockingQueue.java:95)

                              at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)

                              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)

                              at java.lang.Thread.run(Thread.java:619)

                     

                     

                       Locked ownable synchronizers:

                              - None

                     

                     

                    "Remoting "endpoint" task-2" prio=10 tid=0x00007fdfb4045800 nid=0x35d6 waiting on condition [0x00007fdff43d5000]

                       java.lang.Thread.State: WAITING (parking)

                              at sun.misc.Unsafe.park(Native Method)

                              - parking to wait for  <0x00007fe0236e5490> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)

                              at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)

                              at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)

                              at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)

                              at org.xnio.LimitedBlockingQueue.take(LimitedBlockingQueue.java:95)

                              at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)

                              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)

                              at java.lang.Thread.run(Thread.java:619)

                     

                     

                       Locked ownable synchronizers:

                              - None

                     

                     

                    "Remoting "endpoint" task-1" prio=10 tid=0x00007fdfb4044800 nid=0x35d5 waiting on condition [0x00007fdff44d6000]

                       java.lang.Thread.State: WAITING (parking)

                              at sun.misc.Unsafe.park(Native Method)

                              - parking to wait for  <0x00007fe0236e5490> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)

                              at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)

                              at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)

                              at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)

                              at org.xnio.LimitedBlockingQueue.take(LimitedBlockingQueue.java:95)

                              at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)

                              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)

                              at java.lang.Thread.run(Thread.java:619)

                     

                     

                       Locked ownable synchronizers:

                              - None

                     

                     

                    "Remoting "endpoint" write-1" prio=10 tid=0x00007fe038192000 nid=0x35d4 runnable [0x00007fdff45d7000]

                       java.lang.Thread.State: RUNNABLE

                              at sun.nio.ch.EPollArrayWrapper.epollWait(Native Method)

                              at sun.nio.ch.EPollArrayWrapper.poll(EPollArrayWrapper.java:210)

                              at sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:65)

                              at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:69)

                              - locked <0x00007fe0236901c0> (a sun.nio.ch.Util$1)

                              - locked <0x00007fe0236901d8> (a java.util.Collections$UnmodifiableSet)

                              - locked <0x00007fe023690148> (a sun.nio.ch.EPollSelectorImpl)

                              at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:80)

                              at org.xnio.nio.WorkerThread.run(WorkerThread.java:157)

                     

                     

                       Locked ownable synchronizers:

                              - None

                     

                     

                    "Remoting "endpoint" read-1" prio=10 tid=0x00007fe038191800 nid=0x35d3 runnable [0x00007fdff46d8000]

                       java.lang.Thread.State: RUNNABLE

                              at sun.nio.ch.EPollArrayWrapper.epollWait(Native Method)

                              at sun.nio.ch.EPollArrayWrapper.poll(EPollArrayWrapper.java:210)

                              at sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:65)

                              at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:69)

                              - locked <0x00007fe0236931d0> (a sun.nio.ch.Util$1)

                              - locked <0x00007fe0236936b8> (a java.util.Collections$UnmodifiableSet)

                              - locked <0x00007fe023693110> (a sun.nio.ch.EPollSelectorImpl)

                              at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:80)

                              at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:84)

                              at org.xnio.nio.WorkerThread.run(WorkerThread.java:153)

                     

                     

                       Locked ownable synchronizers:

                              - None

                     

                     

                    "Low Memory Detector" daemon prio=10 tid=0x00007fe038090000 nid=0x35d1 runnable [0x0000000000000000]

                       java.lang.Thread.State: RUNNABLE

                     

                     

                       Locked ownable synchronizers:

                              - None

                     

                     

                    "CompilerThread1" daemon prio=10 tid=0x00007fe03808d800 nid=0x35d0 waiting on condition [0x0000000000000000]

                       java.lang.Thread.State: RUNNABLE

                     

                     

                       Locked ownable synchronizers:

                              - None

                     

                     

                    "CompilerThread0" daemon prio=10 tid=0x00007fe03808b000 nid=0x35cf waiting on condition [0x0000000000000000]

                       java.lang.Thread.State: RUNNABLE

                     

                     

                       Locked ownable synchronizers:

                              - None

                     

                     

                    "Signal Dispatcher" daemon prio=10 tid=0x00007fe038089000 nid=0x35ce runnable [0x0000000000000000]

                       java.lang.Thread.State: RUNNABLE

                     

                     

                       Locked ownable synchronizers:

                              - None

                     

                     

                    "Finalizer" daemon prio=10 tid=0x00007fe03806a800 nid=0x35cd in Object.wait() [0x00007fdff4efd000]

                       java.lang.Thread.State: WAITING (on object monitor)

                              at java.lang.Object.wait(Native Method)

                              - waiting on <0x00007fe0236884d0> (a java.lang.ref.ReferenceQueue$Lock)

                              at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)

                              - locked <0x00007fe0236884d0> (a java.lang.ref.ReferenceQueue$Lock)

                              at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)

                              at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)

                     

                     

                       Locked ownable synchronizers:

                              - None

                     

                     

                    "Reference Handler" daemon prio=10 tid=0x00007fe038068800 nid=0x35cc in Object.wait() [0x00007fdff4ffe000]

                       java.lang.Thread.State: WAITING (on object monitor)

                              at java.lang.Object.wait(Native Method)

                              - waiting on <0x00007fe023690340> (a java.lang.ref.Reference$Lock)

                              at java.lang.Object.wait(Object.java:485)

                              at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)

                              - locked <0x00007fe023690340> (a java.lang.ref.Reference$Lock)

                     

                     

                       Locked ownable synchronizers:

                              - None

                     

                     

                    "VM Thread" prio=10 tid=0x00007fe038064000 nid=0x35cb runnable

                     

                     

                    "GC task thread#0 (ParallelGC)" prio=10 tid=0x00007fe03801a000 nid=0x35c7 runnable

                     

                     

                    "GC task thread#1 (ParallelGC)" prio=10 tid=0x00007fe03801b800 nid=0x35c8 runnable

                     

                     

                    "GC task thread#2 (ParallelGC)" prio=10 tid=0x00007fe03801d800 nid=0x35c9 runnable

                     

                     

                    "GC task thread#3 (ParallelGC)" prio=10 tid=0x00007fe03801f800 nid=0x35ca runnable

                     

                     

                    "VM Periodic Task Thread" prio=10 tid=0x00007fe0380a2800 nid=0x35d2 waiting on condition

                     

                     

                    JNI global references: 925

                    • 7. Re: JBossAS7 [thunder] document misleading need correction
                      robertobeeman

                      Hi Scott,

                       

                       

                       

                       

                       

                      java JMXExample

                      Feb 24, 2012 1:22:32 AM org.xnio.Xnio <clinit>

                      INFO: XNIO Version 3.0.3.GA

                      Feb 24, 2012 1:22:32 AM org.xnio.nio.NioXnio <clinit>

                      INFO: XNIO NIO Implementation Version 3.0.3.GA

                      Feb 24, 2012 1:22:32 AM org.jboss.remoting3.EndpointImpl <clinit>

                      INFO: JBoss Remoting version 3.2.2.GA

                      [START] new java.util.Date() : Fri Feb 24 01:22:33 IST 2012

                      240

                      [END] new java.util.Date() : Fri Feb 24 01:22:33 IST 2012

                       

                       

                      But the program actually terminates at     Fri Feb 24 01:23:33 IST 2012

                       

                      Means  it takes 60 seconds before the program gets terminated if i use the following code:

                       

                              //Invoke on the JBoss AS MBean server

                              System.out.println("[START] new java.util.Date() : "+new java.util.Date());

                              int count = connection.getMBeanCount();

                              System.out.println(count);

                             jmxConnector.close();    // If i dont use this line then program never terminates...... if i use this line then it takes 60 Seconds before the program terminates

                              System.out.println("[END] new java.util.Date() : "+new java.util.Date());

                       

                       

                      Attaching 6 Thread Dumps each taken in the interval of 8 Seconds  where we can see all the threads are in same state in all thread dumps no progress is happening.

                      • 8. Re: JBossAS7 [thunder] document misleading need correction
                        smarlow

                        Roberto,

                         

                        I was able to recreate the same (60 second) pause, so its not just you.  Could you create a jira for this (link is https://issues.jboss.org/browse/AS7). 

                         

                        Scott

                        • 9. Re: JBossAS7 [thunder] document misleading need correction
                          dlofthouse

                          FYI - The location to raise issues regarding the Remoting JMX library is here https://issues.jboss.org/browse/REMJMX - but don't worry about that for the moment, I am looking into this now and will create an issue if one is needed.

                          • 10. Re: JBossAS7 [thunder] document misleading need correction
                            dlofthouse

                            Just resolved REMJMX-34 - the call to close that you added is still required but there was one ExecutorService not being cleaned up so that is now shutdown at the time close is called - I am just about to tag a release and push for it's inclusion in AS7 master ready for AS 7.1.1.