3 Replies Latest reply on Oct 11, 2010 6:04 PM by rodrigo.uchoa

    Exposing JMX in 5.1.0 "web" configuration

    kenwdelong

      I want to use the "web" configuration of 5.1.0, but I want to use JBoss AS Tools in Eclipse to start/stop the server.  I also want to keep using the JMX poller, but apparently JMX is not reachable in the web configuration.  I get exceptions like this:

      Exception in thread "main" javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 [Root exception is javax.naming.CommunicationException: Failed to connect to server localhost/127.0.0.1:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost/127.0.0.1:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]]
          at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1763)
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:693)
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
          at javax.naming.InitialContext.lookup(InitialContext.java:392)
          at org.jboss.Shutdown.main(Shutdown.java:219)
      Caused by: javax.naming.CommunicationException: Failed to connect to server localhost/127.0.0.1:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost/127.0.0.1:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]
          at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:335)
          at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1734)
          ... 4 more
      Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server localhost/127.0.0.1:1099 [Root exception is java.net.ConnectException: Connection refused: connect]
          at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:305)
          ... 5 more
      Caused by: java.net.ConnectException: Connection refused: connect
          at java.net.PlainSocketImpl.socketConnect(Native Method)
          at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
          at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
          at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
          at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
          at java.net.Socket.connect(Socket.java:519)
          at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:97)
          at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:82)
          at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:301)
          ... 5 more

       

      I've tried dragging likely files from the "standard" config to the "web" config, but so far to no avail.  Could anyone help me figure out what to install to get this JMX Poller to start working and eliminate the above stack trace?

        • 1. Re: Exposing JMX in 5.1.0 "web" configuration
          rodrigo.uchoa

          I'm having the same problem. Startup/shutdown pollers don't seem to be working when using the web profile. Setting a timeout value is kind of a annoying workaround.

           

          Does anyone know how to turn back on jmx completely when using the web profile?

          • 2. Re: Exposing JMX in 5.1.0 "web" configuration
            kenwdelong

            Ok, I finally got this working.  Here are my details:

            JDK 1.6.0_12

            JBoss 5.1.0 (NOT the jdk6 version, just the standard one)

            Eclipse 3.6.1

            JBoss AS Tools 2.2.0 H23 Beta2 from Sept. 29, 2010

            Start Poller: Web Port Poller

            Shutdown Poller: Process Terminated Poller

             

            The web configuration now starts nicely.  However, when you stop the server with the AS Tools, it blows up because it can't connect to port 1099.  A quick netstat confirms that the server is not opening that port.

             

            This can be fixed by altering web/conf/jboss-service.xml.  Update the defn of the MBean jboss:service=Naming, replace the port:

            <attribute name="Port">
                     <value-factory bean="ServiceBindingManager" method="getIntBinding">
                        <parameter>jboss:service=Naming</parameter>
                        <parameter>Port</parameter>
                     </value-factory>
                  </attribute>

             

            I also set the CallByValue attribute just above it to "true", as it is in the standard configuration.  I haven't tested to see if that is essential.

             

            Now I can run my server from the server panel!!

            • 3. Re: Exposing JMX in 5.1.0 "web" configuration
              rodrigo.uchoa

              This post also has a lot of information on this matter: http://community.jboss.org/thread/156818