14 Replies Latest reply on Dec 9, 2016 7:44 PM by berhauz

    AS 7.1: JMX remote monitoring not working in domain mode?

    hschmidt

      Hi,

       

      Connecting to "service:jmx:remoting-jmx://localhost:9999" works only in standalone mode for me.

       

      Yet, I am not able to connect to jboss 7.1 running in domain mode. I used the standard configuration without any modifications to start jboss in standalone and domain mode.

       

      Is there something that has to be configured first in domain mode?

       

      Thanks

        • 1. Re: AS 7.1: JMX remote monitoring not working in domain mode?
          dlofthouse

          In domain mode the remote access to JMX is exposed over the remoting connector of that AS instance which is mapped to the 'remoting' socket binding which by default starts at 4447 plus any offset.  As this is using the remoting connector of the AS instance the user you use to connect needs to be a user from the ApplicationRealm.

          1 of 1 people found this helpful
          • 2. Re: AS 7.1: JMX remote monitoring not working in domain mode?
            hschmidt

            Darran,

             

            Thank you for your quick reponse.

             

            I added a user to the application realm (verified in application-users.properties) and tried  to connect to "service:jmx:remoting-jmx://localhost:4447"

             

            Unfortunately, this does not work as well and with standard configuration there is no information logged regarding that.

             

            Using telnet I get a connection at localhost:4447...

             

            Any idea?

             

            Thanks in advance

            • 3. Re: AS 7.1: JMX remote monitoring not working in domain mode?
              dlofthouse

              Actually if you are connecting using localhost you should be droppig in without a username and password as the local machanism should be picked up - what environment is this?  Is it possible for you to capture a network trace between the server and the client?

              • 4. Re: AS 7.1: JMX remote monitoring not working in domain mode?
                hschmidt

                In my setup Jboss is running on Windows 7 Pro, jdk1.6.0_21

                 

                I traced the network with wireshark, the following is the tcp stream transmitted:

                 

                .......myhost.mydomain..........endpoint...5......master:server-one..JBOSS-LOCAL-USER.

                DIGEST-MD5......JBOSS-LOCAL-USER....h.C:\Users\me\Downloads\jboss-as-7.1.0.Final\jboss-as-7.1.0.Final\domain\tmp\auth\challenge-4047107...

                ....c.>Ky.............C...jmx....@....P..................C.Unknown service name

                 

                (I set-up another instance on a solaris 10 machine running jdk 1.7. Connecting via jConsole does not work there as well. There is also this "Unknown service name" at the end of the tcp stream...)

                 

                Any idea about this "Unknown service name"?

                 

                Thanks

                • 5. Re: AS 7.1: JMX remote monitoring not working in domain mode?
                  dlofthouse

                  Can you show the JMX subsystem configuration from your domain.xml?  It sounds like JMX may not be registered with the Remoting Endpoint you are connecting to.

                  • 6. Re: AS 7.1: JMX remote monitoring not working in domain mode?
                    hschmidt

                    yes, sure. I just used the default configuration without modifications:

                     

                    I just unzipped jboss-as-7.1.0.Final.zip and started jboss with the command "domain.sh -b 0.0.0.0 -Djboss.bind.address.management=<MY_IP>".

                     

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

                      <show-model value="true"/>

                      <remoting-connector/>

                    </subsystem>

                    • 7. Re: AS 7.1: JMX remote monitoring not working in domain mode?
                      dlofthouse

                      Just double checked the default config and that does appear to have an attribute missing, can you try changing it to: -

                       

                      <remoting-connector use-management-endpoint="false"/>
                      
                      • 8. Re: AS 7.1: JMX remote monitoring not working in domain mode?
                        hschmidt

                        ok - it is working now.

                         

                        Thanks a lot!

                        • 9. Re: AS 7.1: JMX remote monitoring not working in domain mode?
                          saragur

                          hey am looking for some help here, i tried these steps i could telnet the port and hostname. but cant get it in jconsole.. tried hard, atlast asking you the question for configuring...

                          i am using jboss 711 and jdk 1.6 u 04...

                          when i try remoting outside the jboss machine i could see this is server logs

                          08:53:11,931 ERROR [org.jboss.remoting.remote.connection] (Remoting "<hostname>:MANAGEMENT" read-1) JBREM000200: Remote connection failed: java.io.IOException: Received an invalid message length of 1246907721

                           

                           

                          any help would be appreciated greatly.. and a quick response would help me a lot to save time than i break my own head.

                          please do reply.

                          • 10. Re: AS 7.1: JMX remote monitoring not working in domain mode?
                            thesamabey

                            hey, i want to set up jmx remote monitering in jboss eap 6 in  domain mode.

                             

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

                                    <expose-resolved-model/>

                                    <expose-expression-model/>

                            </subsystem>

                             

                            what are the changes i have to do in the jmx subsystem?

                            • 11. Re: AS 7.1: JMX remote monitoring not working in domain mode?
                              antimojv

                              I downloaded jboss 7.1.1 and unzip the files (JBoss Application Server Downloads - JBoss Community)

                               

                              Update domain.xml with

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

                                              <show-model value="true"/>

                                              <remoting-connector use-management-endpoint="false"/>

                                          </subsystem>

                               

                              Start domain  in windows with

                              domain.bat

                               

                              Launch console bundled with jboss and try to connect to

                              service:jmx:remoting-jmx://127.0.0.1:4447

                               

                              I saw with netstat that there is a listener on this port but can't connect to jvm

                               

                              Both with windows console and cygwin

                              Any hint?

                              Did i miss something?

                               

                              Thank you all

                              • 12. Re: AS 7.1: JMX remote monitoring not working in domain mode?
                                nayasoftsolutions

                                Hi All,

                                 

                                     My currently jboss server is running at one of the intranet PC. That is an linux.

                                     Now trying to connect jconsole remote host by using followig hostUrl service:jmx:remoting-jmx://192.168.1.65:9999. But it saying connection was refused. Im trying in standalone mode itself.

                                 

                                i already changed standalone.xml file

                                 

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

                                            <show-model value="true"/>

                                            <remoting-connector use-management-endpoint="false"/>

                                        </subsystem>

                                • 13. Re: AS 7.1: JMX remote monitoring not working in domain mode?
                                  arun2arunraj

                                  Hi Sam,

                                   

                                  Have you found a way to enable JMX SubSystem ?
                                  If yes, Can you share it with us.

                                   

                                  Thanks & Regards,
                                  ArunRaj. R

                                  • 14. Re: AS 7.1: JMX remote monitoring not working in domain mode?
                                    berhauz

                                    configuring <remoting-connector use-management-endpoint="false"/>  is important but not sufficient.

                                     

                                    I found that all the following is actually requested:

                                     

                                    -1- use service:jmx:remote://myServer:8009 instead of service:jmx:remoting-jmx:...

                                    -2- enable the port, here 8009, in domain.xml (or standalone.xml to extrapolate) in four steps:

                                    -2.1- add a socket binding that you'll dedicate to JMX, e.g. <socket-binding name="jmx-remote" port="${jboss.jmx.port:7909}" fixed-port="false"/> (I have a server port offset 100 hence yielding 8009)

                                    -2.2- create a connector in the remoting subsystem, e.g. <subsystem xmlns="urn:jboss:domain:remoting:3.0"> <endpoint /> <connector socket-binding="jmx-remote" name="jmx-remote-connector" security-realm="ApplicationRealm">

                                    -2.3- create a user account in the application or management realm that will be used to log in to JMX

                                    -2.4- because we created a dedicated port binding for JMX, ensure that the jmx subsystem has: <remoting-connector use-management-endpoint="false"/>

                                    -3- ensure jboss-cli-client.jar is on the classpath and/or requested as a dependency in your jar/ear; tip: the jar can be found under <eap7Root>/bin/client subdirectory directory of your EAP installation; without this jar, the JMX protocol "remote" will not be available

                                    Then you are ready to test with such sample code:

                                    import javax.management.MBeanServerConnection;
                                    import javax.management.ObjectName;
                                    import javax.management.remote.JMXConnector;
                                    import javax.management.remote.JMXConnectorFactory;
                                    import javax.management.remote.JMXServiceURL;
                                    [...]
                                    // credentials
                                    Map<String,String[]> env=new HashMap<>();
                                    String[] data=new String[]{"myJmxUser","myPassword"}; 
                                    env.put(JMXConnector.CREDENTIALS, data);

                                    // JMX connection
                                    JMXServiceURL jurl = new JMXServiceURL( "service:jmx:remote://myServer:8009");
                                    JMXConnector connector = JMXConnectorFactory.connect(jurl, env);
                                    MBeanServerConnection connection = connector.getMBeanServerConnection();

                                    // here, we list all queues in the embedded activeMQ server "default" (do not forget to activate JMX in the active-MQ subsystem, search the doc...)
                                    ObjectName objn = new ObjectName("org.apache.activemq.artemis:module=Core,type=Server");
                                    String[] queueNames = (String[]) connection.getAttribute(objn, "QueueNames");
                                    for (String qn : queueNames ) {
                                      System.out.println(qn.toString());
                                    }

                                    connector .close();