4 Replies Latest reply on Jan 30, 2016 12:17 AM by Brad Maxwell

    Unsupported protocol: remoting-jmx!!

    sarahfr Newbie

      hi,

      I deployed my application under jboss 7.1 but I have a problem with  remoting-jmx

       

      private static javax.management.MBeanServerConnection  repository=null;

       

      private static void init() throws IOException

                {

                          try

                          {

                                    final ConnectorFactory factory = new ConnectorFactory(CartSettings.getInstance());

                                    try

                                    {

                                              final ConnectorJMXIdentification jmxIdentification = factory.createConnectorJMXIdentification();

                                              jmxIdentification.verifyJMXIdentification();

       

                                    } catch (ConnectorFactoryException e) {

                                              e.printStackTrace();

                                    }

       

                            String host = "localhost";

                            int port = 9999;  // management-native port

                            String urlString =

                                System.getProperty("jmx.service.url","service:jmx:remoting-jmx://" + host + ":" + port);

                            JMXServiceURL serviceURL = new JMXServiceURL(urlString);

                            JMXConnector jmxConnector = JMXConnectorFactory.connect(serviceURL, null);

                            repository = jmxConnector.getMBeanServerConnection();

                    

                            //Invoke on the JBoss AS MBean server

                        

                                  serverName = new javax.management.ObjectName("cic:type=CICObjectShare");

       

                                    final String tmp = CartSettings.getInstance().getProperty("sharedObjectsTimeout", "0");

                                    final int sharedObjectsTimeout = cic.CICTools.parseInt(tmp);

                                    if (sharedObjectsTimeout>0)

                                              cic.CICObjectShare.TIMEOUT = sharedObjectsTimeout;

       

                          } catch (MalformedObjectNameException e) {

                                    e.printStackTrace();

                          } catch (NullPointerException e) {

                                    e.printStackTrace();

                          }

                }

       

      I have this error:

       

      17:01:11,345 ERROR [stderr] (http--127.0.0.1-8180-1) java.net.MalformedURLException: Unsupported protocol: remoting-jmx

       

      I need your help thanks

        • 1. Re: Unsupported protocol: remoting-jmx!!
          Jay SenSharma Master

          Hi,

           

             Make sure that you set the jboss-client.jar in the classpath of the command prompt/terminal where you are trying to run thic JMX code.

           

          Example:

           

          For UNIX Based Operating System:

           

          export PATH=/home/userone/jdk1.6.0_21/bin:$PATH
          export CLASSPATH=/home/userone/jboss-as-7.1.1.Final/bin/client/jboss-client.jar:$CLASSPATH:.:
          
          ++++++++++++++++++++++++++++++++
          For Windows Based Operating System
          
          set PATH=C:\jdk1.6.0_21\bin;%PATH%
          set CLASSPATH=c:\jboss-as-7.1.1.Final\bin\client\jboss-client.jar;%CLASSPATH%;.;
          

           

           

             Where ever you are running your code .... you should make sure that the "jboss-client.jar" is loaded and becomes available for your JMX code.

           

           

          NOTE:  if you are running your jmx code as part of a Web Application inside the JBoss AS7.1 then make sure that the jboss-client.jar   file is placed inside the "WEB-INF/lib"  directory of your Web Application.

          • 2. Re: Unsupported protocol: remoting-jmx!!
            Brad Maxwell Newbie

            When running in JBoss you need to declare a dependency on this module and make sure import the services else you will get "

            Unsupported protocol: remoting-jmx"

             

            <module name="org.jboss.remoting3.remoting-jmx" services="import"/>

            • 3. Re: Unsupported protocol: remoting-jmx!!
              Sergey Krasovsky Newbie

              I have the same error. The jboss version is 7.1.3.

               

              I'm using jboss like a client to get info from jmx in wowza media server.

               

              String host = "localhost";
              int port = 9999;  // management-native port
              String urlString = System.getProperty("jmx.service.url","service:jmx:remoting-jmx://" + host + ":" + port);
              JMXServiceURL foo = new JMXServiceURL(urlString);
              JMXConnector connector = JMXConnectorFactory.connect(foo, env);
              

               

              1) I'm created new module in the jboss with name jboss-client. Added this module into jboss-deployment-structure.xml

               

              <dependencies>
                   <module name="org.jboss.jboss-client" />
              

               

              2) Done all manipulations, which is described in this discussions.

               

              But the server keep on return the error "java.net.MalformedURLException: Unsupported protocol: remoting-jmx".

               

              What could I forget? Any idea?

               

              Thanks.

              • 4. Re: Unsupported protocol: remoting-jmx!!
                Brad Maxwell Newbie

                <module name="org.jboss.jboss-client" />   != <module name="org.jboss.remoting3.remoting-jmx" services="import"/>

                You should not be creating new modules and putting the jboss-client.jar in it if that is what you did, that is setup for possible class cast exceptions.


                services="import" is needed in the jboss-deployment-structure.xml to allow the client application to see the META-INF/services which is where it is told about the remoting-jmx protocol.

                If your org.jboss.jboss-client is depending on the org.jboss.remoting3.remoting-jmx , then your custom module would need <module name="org.jboss.remoting3.remoting-jmx" services="export"/> to reexport the services