0 Replies Latest reply on Oct 29, 2014 9:50 AM by juergenkindler

    Maven dependencies for connecting to JBoss 6.3.0 EAP via JMX

    juergenkindler

      Hi,

       

      I am trying to do some test automation using JMX with JBoss using JMX urls like service:jmx:remoting-jmx://provider:1100 .

      I have managed to do that in case i fumble the jboss-client.jar into my Maven repository and picking it up from there by the Maven test build.

       

      In the <jboss-Home>/bin/client/README-EJB-JMS.txt that comes along with the distribution I read this:

       

      Maven users should not use this jar, but should use the following BOM dependencies instead

      <dependencies>
          <dependency>
              <groupId>org.jboss.as</groupId>
              <artifactId>jboss-as-ejb-client-bom</artifactId>
              <type>pom</type>
          </dependency>
          <dependency>
              <groupId>org.jboss.as</groupId>
              <artifactId>jboss-as-jms-client-bom</artifactId>
              <type>pom</type>
          </dependency>
      </dependencies>

       

      This is because using maven with a shaded jar has a very high chance of causing class version conflicts, which is why

      we do not publish this jar to the maven repository.

       

      Unfortunately, including those dependencies (and adding the dependent jar files in Maven) do not result in remoting-jmx: being included in the known protocols:

       

      Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'standardTestServiceProvider' defined in class path resource [client_all_envs.xml]: Invocation of init method failed; nested exception is org.springframework.jmx.MBeanServerNotFoundException: Could not connect to remote MBeanServer [service:jmx:remoting-jmx://provider:1100]; nested exception is java.net.MalformedURLException: Unsupported protocol: remoting-jmx

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1482)

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)

          at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)

          at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)

          at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)

          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)

          at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:323)

          ... 20 more

      Caused by: org.springframework.jmx.MBeanServerNotFoundException: Could not connect to remote MBeanServer [service:jmx:remoting-jmx://provider:1100]; nested exception is java.net.MalformedURLException: Unsupported protocol: remoting-jmx

          at org.springframework.jmx.access.ConnectorDelegate.connect(ConnectorDelegate.java:65)

          at org.springframework.jmx.access.MBeanClientInterceptor.prepare(MBeanClientInterceptor.java:260)

          at org.springframework.jmx.access.MBeanClientInterceptor.afterPropertiesSet(MBeanClientInterceptor.java:245)

          at org.springframework.jmx.access.MBeanProxyFactoryBean.afterPropertiesSet(MBeanProxyFactoryBean.java:80)

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1541)

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1479)

          ... 27 more

      Caused by: java.net.MalformedURLException: Unsupported protocol: remoting-jmx

          at javax.management.remote.JMXConnectorFactory.newJMXConnector(JMXConnectorFactory.java:357)

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

          at org.springframework.jmx.access.ConnectorDelegate.connect(ConnectorDelegate.java:61)

          ... 32 more

       

      What would be the right way to include dependencies via Maven, if the usage of jboss-client.jar is discouraged???

       

      Cheers

        Jürgen