4 Replies Latest reply: Sep 20, 2011 6:19 AM by Megha Shah RSS

JBoss 6.0.0M3 stopping by specifying host/port

Wolfgang Knauf Master

Hi,

 

seems there was a major change when stopping a JBoss by specifying host and port (required in Eclipse, when non default ports are used).

 

For 6.0.0M2 and previous, this was:

shutdown.bat -s jnp://localhost:1099

(Source of this approach: http://www.eclipse.org/forums/index.php?t=msg&goto=489439 )

 

For 6.0.0M3, this seems to have changed (as a "shutdown.bat --help" reveals).

shutdown.bat -s service:jmx:rmi:///jndi/rmi://localhost:1090/jmxrmi

 

If using the old approach, this results in an exception:

 

Exception in thread "main" java.net.MalformedURLException: Service URL must start with service:jmx:        at javax.management.remote.JMXServiceURL.<init>(JMXServiceURL.java:143)        at org.jboss.Shutdown.main(Shutdown.java:235)

 

 

I didn't find something in the release notes, so I want to ask here whether my assumptions are correct:

 

a) shutdown has moved away from from port 1099 to port 1090 and a different URL?

b) The Eclipse ant file requires an additional parameter "RMI/JRMP socket for connecting to the JMX MBeanServer", which defaults to 1090 (additionaly to the "jndiPort" parameter of 1099)?

 

Am I right, or is there further change planned?

 

Best regards

 

Wolfgang

  • 1. Re: JBoss 6.0.0M3 stopping by specifying host/port
    jaikiran pai Master

    This change was carried out as part of https://jira.jboss.org/browse/JBAS-7825

     

    I think it should have made it to the readme and eventually should make the installation/configuration documentation of AS.

     

    Wolfgang Knauf wrote:

     


    b) The Eclipse ant file requires an additional parameter "RMI/JRMP socket for connecting to the JMX MBeanServer", which defaults to 1090 (additionaly to the "jndiPort" parameter of 1099)?

     


     

    I don't use Eclipse for managing AS, so I might not make much sense, but I think you will no longer need the 1099 and jndiPort parameter in that Eclipse file.

     

    Wolfgang Knauf wrote:

     


     

    I didn't find something in the release notes, so I want to ask here whether my assumptions are correct:

     

    a) shutdown has moved away from from port 1099 to port 1090 and a different URL?


    Yes that's correct. Moved from the naming port (1099) to RMI/JRMP port for connecting to the JMX MBeanServer (1090).

     

     

     

     

    Wolfgang Knauf wrote:

     


     

    Am I right, or is there further change planned?

     

    The main task seems to be still open. So I am not sure if anything else will change.

  • 2. Re: JBoss 6.0.0M3 stopping by specifying host/port
    Scott Marlow Master

    One more change was made earlier this week, https://jira.jboss.org/browse/JBIDE-6297 was fixed to use the new JSR-160 URL syntax.  That change should help the Eclipse experience.  :-)  It was made in a way that is backward compatable with earlier (than AS6) releases.  The older URL syntax is used against the earlier releases of AS.

     

    The JMX Connector is looked up through port 1090 (see jmx-jboss-beans.xml in the deploy folder).  One more change is probably going to happen for how the JMX connector is deployed but that should impact AS internals (jmx-jboss-beans.xml will likely change which is the user visible part).

     

    More on the shutdown command is here http://community.jboss.org/wiki/StartStopJBoss

     

    You are correct for (a).  Port and URL changed (also new options for host/port are available which is an alternative to the URL).

     

    I'm not sure about (b).

     

    Regards,

    Scott

  • 3. Re: JBoss 6.0.0M3 stopping by specifying host/port
    Wolfgang Knauf Master

    Thanks for your replys and the JIRA links. Now I feel better and hope that this will last for a very long time ;-).

     

    Scott, your wiki article at http://community.jboss.org/wiki/StartStopJBoss does not mention the "long" URL parameter as an alternative way ;-).

     

    Best regards

     

    Wolfgang

  • 4. Re: JBoss 6.0.0M3 stopping by specifying host/port
    Megha Shah Newbie

    Hi Wolfgang,

     

    I was redirected to this post vide the thread http://community.jboss.org/message/611136#611136

    I have tried to setup the shutdown script as follows

     

    ./shutdown.sh -s service:jmx:rmi:///jndi/rmi://localhost:1098/jmxrmi


    and getting the below exception:

     

    -bash-3.2$ ./shutdown_ports_01.sh

    Exception in thread "main" java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:

            java.net.ConnectException: Connection refused]

            at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:338)

            at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248)

            at org.jboss.Shutdown.main(Shutdown.java:235)

    Caused by: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:

            java.net.ConnectException: Connection refused]

            at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:101)

            at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:185)

            at javax.naming.InitialContext.lookup(InitialContext.java:392)

            at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1886)

            at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1856)

            at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:257)

            ... 2 more

    Caused by: java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:

            java.net.ConnectException: Connection refused

            at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)

            at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)

            at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)

            at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)

            at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)

            at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:97)

            ... 7 more

    Caused by: java.net.ConnectException: Connection refused

            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:529)

            at java.net.Socket.connect(Socket.java:478)

            at java.net.Socket.<init>(Socket.java:375)

            at java.net.Socket.<init>(Socket.java:189)

            at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)

            at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)

            at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)

            ... 12 more

     

    Am using the port 1098 by referring the xml from jboss/server/ports-01/conf/bindingservice.beans/META-INF/bindings-jboss-beans.xml

    I am using the ports-01 set.

     

       <!-- Provides management tools with a ProfileService ManagementView

            interface to the SBM and its components -->

       <bean name="ServiceBindingManagementObject"

             class="org.jboss.services.binding.managed.ServiceBindingManagementObject">

     

     

          <constructor>

             <!-- The name of the set of bindings to use for this server -->

             <parameter>${jboss.service.binding.set:ports-01}</parameter>

     

     

             <!--  The binding sets -->

             <parameter>

                <set>

                   <inject bean="PortsDefaultBindings"/>

                   <inject bean="Ports01Bindings"/>

                   <inject bean="Ports02Bindings"/>

                   <inject bean="Ports03Bindings"/>

                </set>

             </parameter>

     

     

             <!-- Base binding metadata that is used to create bindings for each set -->

             <parameter><inject bean="StandardBindings"/></parameter>

     

     

          </constructor>

       </bean>

    .

    .

    .

    .

    .

    .

     

       <!-- The ports-01 bindings are obtained by taking the base bindings and adding 100 to each port value -->

       <bean name="Ports01Bindings" class="org.jboss.services.binding.impl.ServiceBindingSet">

          <constructor>

             <!--  The name of the set -->

             <parameter>ports-01</parameter>

             <!-- Default host name -->

             <parameter>${jboss.bind.address}</parameter>

             <!-- The port offset -->

             <parameter>100</parameter>

             <!-- Set of bindings to which the "offset by X" approach can't be applied -->

             <parameter><null/></parameter>

          </constructor>

       </bean>

     

       <!-- Base binding metadata that ServiceBindingStore uses to create bindings for each set -->

       <bean name="StandardBindings" class="java.util.HashSet">

          <constructor>

             <parameter class="java.util.Collection">

                <set elementClass="org.jboss.services.binding.ServiceBindingMetadata">

                <!-- ********************* conf/jboss-service.xml ****************** -->

     

     

                <!-- Naming Service -->

                <bean class="org.jboss.services.binding.ServiceBindingMetadata">

                   <property name="serviceName">jboss:service=Naming</property>

                   <property name="bindingName">Port</property>

                   <property name="port">1099</property>

                   <property name="description">The listening socket for the Naming service</property>

                </bean>

     

     

                <bean class="org.jboss.services.binding.ServiceBindingMetadata">

                   <property name="serviceName">jboss:service=Naming</property>

                   <property name="bindingName">RmiPort</property>

                   <property name="port">1098</property>

                   <property name="description">Socket Naming service uses to receive RMI requests from client proxies</property>

                </bean>

     

     

                <!-- Remote classloading service -->

                <bean class="org.jboss.services.binding.ServiceBindingMetadata">

                   <property name="serviceName">jboss:service=WebService</property>

                   <property name="port">8083</property>

                   <property name="description">Socket for dynamic class and resource loading</property>

                </bean>

     

     

                <!-- Remoting 2 Connector -->

                <bean class="org.jboss.services.binding.ServiceBindingMetadata">

                   <property name="serviceName">UnifiedInvokerConnector</property>

                   <property name="port">4446</property>

                   <property name="description">Socket for JBoss Remoting Connector used by UnifiedInvoker</property>

                </bean>

     

     

     

    Can you please let me know where I am going wrong