Announcement Announcement Module
Collapse
No announcement yet.
MBeanServerConnectionFactoryBean with Websphere Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • MBeanServerConnectionFactoryBean with Websphere

    Hello,

    I'd like to use MBeanServerConnectionFactoryBean on Websphere 5.0.

    But I don't know how to set the 'serviceUrl' property (which protocol to use, where is defined the corresponding port, etc.)

    Do someone have a positive experience with this server and can help me to write the correct connection url ?

    Thank You.

  • #2
    Have you looked at the reference documentation?
    <bean id="clientConnector" class="org.springframework.jmx.support.MBeanServer ConnectionFactoryBean">
    <property name="serviceUrl" value="service:jmx:rmi://localhost:9875"/>
    </bean>

    Comment


    • #3
      Thank you for your response.

      I've read the documentation. But if I try this configuratiion, I've the following error :

      org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'clientConnector' defined in class path resource [config-mbean.xml]: Initialization of bean failed; nested exception is java.net.MalformedURLException: URL path must begin with /jndi/ or /stub/ or /ior/:
      java.net.MalformedURLException: URL path must begin with /jndi/ or /stub/ or /ior/:
      at javax.management.remote.rmi.RMIConnector.findRMISe rver(RMIConnector.java:1759)
      at javax.management.remote.rmi.RMIConnector.connect(R MIConnector.java:259)
      at javax.management.remote.JMXConnectorFactory.connec t(JMXConnectorFactory.java:247)
      at org.springframework.jmx.support.MBeanServerConnect ionFactoryBean.connect(MBeanServerConnectionFactor yBean.java:146)
      at org.springframework.jmx.support.MBeanServerConnect ionFactoryBean.afterPropertiesSet(MBeanServerConne ctionFactoryBean.java:114)
      at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1059)
      at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:363)
      at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:226)
      at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:147)
      at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:269)
      at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:320)
      at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:87)
      at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:72)
      at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:63)

      I'm using JDK 1.4.2...

      Comment


      • #4
        The value should be
        service:jmx:rmi://localhost/jndi/rmi://localhost:1099/blabla

        Comment


        • #5
          Actually this bug should have been solved since 1.2.3:
          http://opensource2.atlassian.com/pro...browse/SPR-977

          Comment


          • #6
            MBeanServerConnectionFactoryBean and mx4j

            Hi there,

            I'm having trouble connecting to a CruiseControl JMX server which is running on my local machine.

            This is what my configuration looks like:

            <bean id="clientConnector" class="org.springframework.jmx.support.MBeanServer ConnectionFactoryBean">
            <property name="serviceUrl" value="service:jmx:rmi://localhost:1099"/>
            </bean>

            The CruiseControl server was started on port 8000, but its RMI port is 1099.

            When I try to access this bean I get an error message saying:

            aused by: java.net.MalformedURLException: Unsupported binding: service:jmx:rmi://localhost:1099/
            at mx4j.remote.resolver.rmi.Resolver.decodeStub(Resol ver.java:144)
            at mx4j.remote.resolver.rmi.Resolver.lookupRMIServerS tub(Resolver.java:75)
            at mx4j.remote.resolver.rmi.Resolver.lookupClient(Res olver.java:52)
            at javax.management.remote.rmi.RMIConnector.connect(R MIConnector.java:120)
            at javax.management.remote.JMXConnectorFactory.connec t(JMXConnectorFactory.java:38)
            at org.springframework.jmx.support.MBeanServerConnect ionFactoryBean.connect(MBeanServerConnectionFactor yBean.java:117)
            at org.springframework.jmx.support.MBeanServerConnect ionFactoryBean.afterPropertiesSet(MBeanServerConne ctionFactoryBean.java:105)
            at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1062)
            at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1029)
            at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:420)
            at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 45)
            at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:141)
            at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:242)
            at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:156)
            at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:287)
            at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:348)
            at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:92)
            at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:77)
            at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:68)
            at JMXTest.getBean(JMXTest.java:134)
            at JMXTest.forceBuild(JMXTest.java:48)
            at JMXTest.main(JMXTest.java:41)
            Exception in thread "main"

            I've tried changing the configuration to look like this:

            <bean id="clientConnector" class="org.springframework.jmx.support.MBeanServer ConnectionFactoryBean">
            <property name="serviceUrl" value="service:jmx:rmi://localhost/jndi/rmi://localhost:1099"/>
            </bean>

            but I just get a ClassCastexception:

            Caused by: java.lang.ClassCastException
            at mx4j.remote.resolver.rmi.Resolver.narrowRMIServerS tub(Resolver.java:117)
            at mx4j.remote.resolver.rmi.Resolver.lookupStubInJNDI (Resolver.java:95)
            at mx4j.remote.resolver.rmi.Resolver.lookupRMIServerS tub(Resolver.java:72)
            at mx4j.remote.resolver.rmi.Resolver.lookupClient(Res olver.java:52)
            at javax.management.remote.rmi.RMIConnector.connect(R MIConnector.java:120)
            at javax.management.remote.JMXConnectorFactory.connec t(JMXConnectorFactory.java:38)
            at org.springframework.jmx.support.MBeanServerConnect ionFactoryBean.connect(MBeanServerConnectionFactor yBean.java:117)
            at org.springframework.jmx.support.MBeanServerConnect ionFactoryBean.afterPropertiesSet(MBeanServerConne ctionFactoryBean.java:105)
            at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1062)
            at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1029)
            at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:420)
            at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 45)
            at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:141)
            at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:242)
            at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:156)
            at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:287)
            at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:348)
            at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:92)
            at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:77)
            at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:68)
            at JMXTest.getBean(JMXTest.java:134)
            at JMXTest.forceBuild(JMXTest.java:48)
            at JMXTest.main(JMXTest.java:41)

            Any ideas on where I can get by this error.

            Thanks

            Sean

            PS. using Spring 2.0 and JDK 1.4 in Eclipse 3.0
            Last edited by Sean O Shea; Oct 26th, 2006, 12:06 PM.

            Comment


            • #7
              service:jmx:rmi://localhost/jndi/rmi://localhost:1099

              should be
              service:jmx:rmi://localhost/jndi/rmi://localhost:1099/jmxrmi

              Comment

              Working...
              X