Announcement Announcement Module
Collapse
No announcement yet.
Exposing spring JMX MBeans in Weblogic 9.2 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Exposing spring JMX MBeans in Weblogic 9.2

    I'm using spring 2.0.8 with weblogic 9.2 and java 1.5 and I have a class with attributes I wish to expose annotated with the 1.5 JMX annotations, implementing an interface containing the methods I wish to expose. Here's the relevent section of my application context config:


    Code:
    	<!-- JMX Config -->
        <bean id="namingStrategy"
              class="org.springframework.jmx.export.naming.MetadataNamingStrategy">
            <property name="attributeSource" ref="jmxAttributeSource"/>
        </bean>
        
        <bean id="jmxAttributeSource"
              class="org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource"/>  
      
        <bean id="assembler"
              class="org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler">
            <property name="attributeSource" ref="jmxAttributeSource"/>
        </bean>
        
       <bean id="exporter" class="org.springframework.jmx.export.MBeanExporter" lazy-init="false">
          <property name="beans">
          <map>
            <entry key="bean:name=paymentProcessor" value-ref="paymentProcessor"/>
          </map>
        </property> 
        <property name="registrationBehaviorName" value="REGISTRATION_REPLACE_EXISTING"/>
        <property name="assembler" ref="assembler"/>
        <property name="namingStrategy" ref="namingStrategy"/>   
        <property name="autodetect" value="true"/>
        <property name="server" ref="runtimeMbeanServerConnection"/>
       </bean>    
    
    <bean id="server" class="org.springframework.jndi.JndiObjectFactoryBean">
    	  	<property name="jndiName" value="java:comp/env/jmx/runtime" />
    	</bean>
    </bean>
    When I deploy my application as an .ear file to weblogic, I can't find the paymentProcessor mbean that I've defined - by using the weblogic wlconfig ant task as follow:
    Code:
    <wlconfig url="t3://hostname:port" username="system" password="weblogic" >
            <get mbean="bean:name=PaymentProcessor"  attribute="myAttribute" property="att" /> 	
          </wlconfig>
          <echo  message="PauseInterval : ${att}" />
    This returns me the message: Could not find provider: bean:name=PaymentProcessor

    Does any of this look wrong? Is there anything else I should be configuring to get this working? Many thanks!
    Last edited by mirageman; Jan 24th, 2008, 11:51 AM.

  • #2
    Can no one help me with this problem? I'm still stuck!

    Comment


    • #3
      Typo?

      Hello.

      Maybe this reply is not useful anymore, but here goes: I do not know if this is a typo or if it is intentional just for the purpose of illustration, but you are injecting the server with another name. The name of your MBeanServer bean is not the one you are injecting, but 'server'.

      I wish I could help more, but I am not accessing the mbeans the way you are.


      Rgds.

      J.

      Comment


      • #4
        Say, you're probably beyond this now, but I see in your Spring configuration the MBean is identified as "bean:name=paymentProcessor", but in your weblogic config it is "bean:name=PaymentProcessor". Was that intentional?

        Comment

        Working...
        X