8 Replies Latest reply on Nov 7, 2012 12:58 PM by heyw

    Using VisualVM with JBoss AS 7

    peterfry

      I tried to use VisualVM with JBoss AS 7.1 Final and the basic jvm monitoring works fine (not very surprising).

       

      The problem arises on the sampler tab as none of the sample options ('CPU', 'Memory' etc.) are available and reason given is

       

      CPU sampling:

      Not available. Failed to create JMX connection to target application. Use 'Add JMX Connection' action to attach to the application.

       

      The only problem here is that the classpath isn't setup for JBoss AS 7.1  so you can't use the JBoss specific jmx service protocol.

       

      Is there any intention to add a JBoss AS 7.1 enabled version of the jvisualvm executable in the same way as there is a JBoss AS 7.1 version of the jconsole executable?

       

      Cheers,

       

      Peter.

        • 1. Re: Using VisualVM with JBoss AS 7
          dlofthouse

          Are you running locally or remotely from the AS instance?  For the moment as with any other process you should be able to establish a local connection to JMX without needing to go over Remoting.

           

          Regarding a start script - it is not something currently planned but please go ahead and raise a feature request in Jira so we can see what we can do.  If someone did say manage to get it working and comment in the Jira that would make it a lot quicker for us to add something ;-)  Generally all that is needed is the correct jars adding to the classpath and the replacement jconsole scripts can be used as guidance to identify the required jars - after that the remoting-jmx url is avaiable by searching the classpath at the time a connection is attempted so there is no configuration required beyond that.

          • 2. Re: Using VisualVM with JBoss AS 7
            johara

            Someone i was working with today requested this, so I created two scripts (based on the jconsole scripts), one for linux and one for windows. They work in the same way as jconsole, i.e. they are executed from $JBOSS_HOME/bin

             

            https://github.com/johnaoahra80/jboss-as-tool-integration/tree/master/visualvm

             

            I you think they might be useful, i can raise a feature request in Jira

             

            Thanks

             

            John

            • 3. Re: Using VisualVM with JBoss AS 7
              jaikiran

              John, welcome to the forums!

               

              Please create a feature request here https://issues.jboss.org/browse/AS7 and point it to this thread as reference. If you want to provide this as a patch, please follow the instructions here http://community.jboss.org/wiki/HackingonAS7

              • 4. Re: Using VisualVM with JBoss AS 7
                madhuy

                Thank you for the tool.

                It was veryhelpful.

                 

                Regards,

                Madhu

                • 5. Re: Using VisualVM with JBoss AS 7
                  matlach
                  • 6. Re: Using VisualVM with JBoss AS 7
                    tnfink

                    We wrote down our experiences with Visual VM and AS 7 in this blog:

                    http://blog.akquinet.de/2012/11/01/connecting-visualvm-with-a-remote-jboss-as-7-eap6-jvm-process/

                     

                    Maybe it is of some help.

                    • 7. Re: Using VisualVM with JBoss AS 7
                      erasmomarciano

                      HI

                       

                      I have this error

                       

                      12:02:07,337 ERROR [org.jboss.remoting.remote.connection] (Remoting "mino-giralatina:MANAGEMENT" read-1) JBREM000200: Remote connection failed: java.io.IOException: Received an invalid message length of 1246907721

                      12:02:07,685 ERROR [org.jboss.remoting.remote.connection] (Remoting "mino-giralatina:MANAGEMENT" read-1) JBREM000200: Remote connection failed: java.io.IOException: Received an invalid message length of 369295616

                       

                      I'm usign

                       

                      JBoss 7.1

                       

                      java version "1.7.0_09"

                      Java(TM) SE Runtime Environment (build 1.7.0_09-b05)

                      Java HotSpot(TM) Server VM (build 23.5-b02, mixed mode)

                       

                      Can I help me?

                      • 8. Re: Using VisualVM with JBoss AS 7
                        heyw

                        Maybe you use the wrong endpoint for the connection.

                         

                        erasmo2 marciano2 schrieb:

                        ...

                        12:02:07,337 ERROR [org.jboss.remoting.remote.connection] (Remoting "mino-giralatina:MANAGEMENT" read-1) JBREM000200: Remote connection failed: java.io.IOException: Received an invalid message length of 1246907721

                        12:02:07,685 ERROR [org.jboss.remoting.remote.connection] (Remoting "mino-giralatina:MANAGEMENT" read-1) JBREM000200: Remote connection failed: java.io.IOException: Received an invalid message length of 369295616

                        ...

                        If you are running the server in the standalone mode the native management endpoint will be used. The default port of the native management interface is 9999.

                         

                        JMX subsystem configuration in standalone mode:

                         

                        <subsystem xmlns="urn:jboss:domain:jmx:1.1">
                           <show-model value="true"/>
                           <remoting-connector />
                         </subsystem>
                        
                        

                         

                        JMX Connection URL: service:jmx:remoting-jmx:IP:9999

                        IP = the binding of the management interface

                         

                        If you are running the server in the domain mode, the remoting endpoint will be used.

                        The default port of the remoting connector in the domain mode is 4447 plus port offset, if configured.

                         

                        JMX subsystem configuration in domain mode:

                         

                        <subsystem xmlns="urn:jboss:domain:jmx:1.1">
                           <show-model value="true"/>
                           <remoting-connector use-management-endpoint="false"/>
                        </subsystem>
                        

                         

                        JMX Connection URL: service:jmx:remoting-jmx:IP:4447

                        IP = the binding of the management interface of a server instance from the domain