12 Replies Latest reply on Mar 13, 2013 7:41 AM by rybex

    Connect to remote JBoss AS 7.x (Jconsole)

    rybex Newbie

      Hello

      At the start sorry for my english becouse i dont speak very well. I have some question. I try to connect to remote JBoss. I have read this article:

       

      https://community.jboss.org/wiki/UsingTheCLIRemoteClientJar

       

      I have tried this way but still no conection.

       

      1. I downloaded jboss-client.jar from the server.

      2. I run jconsole this way: jconsole -J-Djava.class.path=<PATH TO jconsole.jar>;<PATH TO tools.jar>;<PATH TO jboss-cli-client.jar>

      3 To connect to JMX I used this url service:jmx:remoting-jmx://{host_name}:{port} (port I got from standalone.xml <socket-binding name = jmx-connector-registry" port="xxxx">)

       

      And still is no connect. In standalone.xml I have added:

      <interface name="management">

      <any-ipv4-address/>

      </interface>

       

      Please give me some tip. Is it correct??

        • 1. Re: Connect to remote JBoss AS 7.x (Jconsole)
          Jay SenSharma Master

          Hi,

           

              In your standalone.xml   you will find following Socket Binding:

           

                  <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>

           

              Use that port in the URL    service:jmx:remoting-jmx://{host_name}:{port}

          • 2. Re: Connect to remote JBoss AS 7.x (Jconsole)
            rybex Newbie

            Thank you for your reply. Still don't work. But now jconsole give me some output:

             

            mar 11, 2013 9:40:18 AM org.xnio.Xnio <clinit>
            INFO: XNIO Version 3.0.4.GA-redhat-1
            mar 11, 2013 9:40:18 AM org.xnio.nio.NioXnio <clinit>
            INFO: XNIO NIO Implementation Version 3.0.4.GA-redhat-1
            mar 11, 2013 9:40:18 AM org.jboss.remoting3.EndpointImpl <clinit>
            INFO: JBoss Remoting version 3.2.8.GA-redhat-1

            • 3. Re: Connect to remote JBoss AS 7.x (Jconsole)
              Jay SenSharma Master

              Hi,

               

                 Are you starting JBoss like following:   (assuming that 10.10.10.10  is the ip adddress of your intranet)

               

                ./standalone.sh    -b 10.10.10.10   -bmanagement 10.10.10.10

               

                 Then whilc connnecting via JConsole   you can use the following kind of   URL:      service:jmx:remoting-jmx://10.10.10.10:9999

               

               


                  Till JBoss AS 7.1.2 there was an issue reported that it hangs while making a remote connection via JConsole. as mentioned in [1]

                 [1] https://issues.jboss.org/browse/JBPAPP6-1011

               

              JIRA has a workaround :  To avoid this hang create a copy of the jconsole script - e.g. jconsole_nocli and remove the module 'org/jboss/as/cli' from the list of modules.  This removal will prevent the discovery of the CLI GUI integration so the attempt to connect to the management channel will not be attempted.

               

               

                  Can you let us know which version of JBoss are you using and the exact command which you are using to start your JBoss .

               

              Thanks

              • 4. Re: Connect to remote JBoss AS 7.x (Jconsole)
                rybex Newbie

                Hi,

                 

                Version of JBoss 7.0.1. I am starting JBoss like your example. I have removed the module 'org/jboss/as/cli' from jconsole.sh and it doesn't help.

                Thanks

                • 5. Re: Connect to remote JBoss AS 7.x (Jconsole)
                  Jay SenSharma Master

                  Hi,

                   

                     Ahhhh!

                   

                     For JBoss AS7.0.1  you will need to follow the below stepa:

                   

                  Step-1).   Alter your standalone*.xml as following:

                   

                  <subsystem xmlns="urn:jboss:domain:jmx:1.1" show-model="true">
                      <jmx-connector registry-binding="jmx-connector-registry" server-binding="jmx-connector-server"/>
                  </subsystem>
                  

                   

                  Step-2). Make sure that the Socket binding are properly configiured as following:

                   

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

                   

                  Step-3). Now start your JBoss profile and then using JConsole you can use the following format of  URL   (No need to put any JBoss specific classes on JConsole classpath  if using JBoss AS7.0.1)

                   

                       

                   service:jmx:rmi:///jndi/rmi://10.10.10.10:1090/jmxrmi"
                  

                   

                   

                   

                   

                  **NOTE:**  from JBossAS 7.1 onwards (see link-1) you can not access JMX registry/JMXServer  using Rmi  so you will need to follow the new URL format. service:jmx:remoting-jmx://{host_name}:{port} 

                   

                  Link-1:  https://community.jboss.org/wiki/UsingJconsoleToConnectToJMXOnAS7

                  • 6. Re: Connect to remote JBoss AS 7.x (Jconsole)
                    Jay SenSharma Master

                    It's better to be on the Updated JBossAS7.
                    Atleast use AS7.1.2 which is much more stable than it's previous releases.     It would be much better if you use JBossAS7.2  

                     

                    JBoss AS 7 nightly builds can be obtained from this CI job https://ci.jboss.org/jenkins/job/JBoss-AS-7.x-latest/. Just click on the link under "Last Successful Artficats"  https://ci.jboss.org/jenkins/job/JBoss-AS-7.x-latest/lastSuccessfulBuild/artifact/build/target/jboss-as-7.x.zip to download the latest nightly build and start using it.

                    • 7. Re: Connect to remote JBoss AS 7.x (Jconsole)
                      rybex Newbie

                      Hi,

                       

                      I have made changes in standalone.xml. Now I am waiting for restart JBoss. I haven't permission for do that myself I write if it will not work.

                       

                      Thanks

                      • 8. Re: Connect to remote JBoss AS 7.x (Jconsole)
                        rybex Newbie

                        Hi

                         

                        I have restarted jboss and still i can't connect. I don't know what to do. Do you have another idea??

                         

                        Thanks

                        • 9. Re: Connect to remote JBoss AS 7.x (Jconsole)
                          Jay SenSharma Master

                          Rybex,

                           

                              Provide the detailed step....  Like

                           

                          1). How you started your JBoss (Exact command)

                          2). What URL are you typing in the JConsole in order to connect to JBoss remotely ?   like service:jmx:rmi:///jndi/rmi://10.10.10.10:1090/jmxrmi"

                          3). Of JBoss and JConsoles are located in remote Boxes so are you able to able to telnet the JBoss on 1090 port  from the box where JConsole is actually running ?

                               Example:

                               telnet   10.10.10.10  9999

                           

                          4). Do you get any error/exception?

                          • 10. Re: Connect to remote JBoss AS 7.x (Jconsole)
                            rybex Newbie

                            Hi,

                             

                            I have updated JBoss to version 7.1.2.

                            • 11. Re: Connect to remote JBoss AS 7.x (Jconsole)
                              rybex Newbie

                              Hi,

                               

                              Now i am trying to connect by jconsole and still nothing.

                               

                              1) Version is 7.1.2

                              2) I start JBoss by:

                              ./standalone.sh    -b 10.10.10.10   -bmanagement 10.10.10.10

                              3) I use Url :
                              service:jmx:remoting-jmx://{host_name}:{port}

                              Where port is 59999 in standalone.xml

                              <socket-binding name="management-native" interface="management" port="59999"/>

                              4) I tried connect by telnet this way:

                              telnet 10.10.10.10 59999

                              And I see something like this:

                              >tstapp.insgl.puk_

                               

                              Thanks


                               


                              • 12. Re: Connect to remote JBoss AS 7.x (Jconsole)
                                rybex Newbie

                                In standalone/log I have some Ecxeptions:

                                 

                                [2013-03-13 09:32:26.573] ERROR [Remoting "sougtstapp01:MANAGEMENT" read-1] [] [connection] JBREM000200: Remote connection failed: java.io.IOException: Received an invalid message length of 218762506

                                [2013-03-13 09:32:50.310] ERROR [Remoting "sougtstapp01" read-1] [] [connection] JBREM000200: Remote connection failed: java.io.IOException: Received an invalid message length of 1937006962

                                [2013-03-13 09:33:40.433] ERROR [Remoting "sougtstapp01" read-1] [] [connection] JBREM000200: Remote connection failed: java.io.IOException: Received an invalid message length of 218762506