Results 1 to 10 of 17

Thread: JMX in Weblogic 9

Hybrid View

  1. #1
    Join Date
    Aug 2004
    Location
    Philadelphia, PA, USA
    Posts
    17

    Default JMX in Weblogic 9

    Can anyone provide a configuration excerpt for Weblogic 9 and JMX?

    I'm having a really frustrating time trying to connect to the embedded MBeanServer in WL9. Here is what I have so far but the exporter fails at startup because it says it can find an MBean Server...

    <bean id="exporter" class="org.springframework.jmx.export.MBeanExporte r">
    <property name="beans">
    <map>
    <!-- there is a bean named 'repository' defined elsewhere -->
    <entry key="bean:name=repository1" value-ref="repository"/>
    </map>
    </property>
    </bean>

    <!-- expose weblogic server's runtime mbeanserver connection -->
    <bean id="runtimeMbeanServerConnection"
    class="org.springframework.jmx.support.MBeanServer ConnectionFactoryBean">
    <property name="serviceUrl"
    value="service:jmx:t3://${WS_HOST}:${WS_PORT}/jndi/weblogic.management.mbeanservers.runtime"/>
    <property name="environment">
    <props>
    <prop key="java.naming.security.principal">${WS_USERNAME }</prop>
    <prop key="java.naming.security.credentials">${WS_USERNA ME}</prop>
    <prop key="jmx.remote.protocol.provider.pkgs">weblogic.m anagement.remote</prop>
    </props>
    </property>
    </bean>

    Basically, I need to know how to set the "server" property on the exporter. Thanks, in advance.

    Dan.
    Dan Hayes
    J2EE Architect
    http://www.mydogboris.com

  2. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    Have you looked at WebLogicMBeanServerFactoryBean?
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  3. #3
    Join Date
    Feb 2005
    Location
    Boston, MA
    Posts
    1,142

    Default

    His example is taken from the BEA dev2dev site, so I imagine its what BEA recommends for Weblogic 9.

    The problem with that example is there is a typo:

    Code:
             <prop key="java.naming.security.principle">
                ${WS_USERNAME}</prop>
             <prop key="java.naming.security.credentials">
                ${WS_USERNAME}</prop>
    should read:

    Code:
             <prop key="java.naming.security.principle">
                ${WS_USERNAME}</prop>
             <prop key="java.naming.security.credentials">
                ${WS_PASSWORD}</prop>
    Unless of course your username and password values are the same for your server.

    Of course the various variables would have to inserted into the appliation context using a PropertyPlaceholderConfigurer, something they don't mention in the BEA example.

  4. #4
    Join Date
    Aug 2004
    Posts
    1,104

    Default

    Also, shouldn't it be
    Code:
    java.naming.security.principal
    Thomas Risberg
    SpringSource by Pivotal
    http://www.springsource.org

  5. #5
    Join Date
    Aug 2004
    Location
    Philadelphia, PA, USA
    Posts
    17

    Default

    The WeblogicMBeanServerFactoryBean utilizes the weblogic.management.Helper class to locate the MBeanServer (via the MBeanHome interface). This interface has been deprecated for 9.0. According to the docs:

    "Deprecated. 9.0.0.0 Replaced by standard JMX design patterns in which clients use the javax.management.MBeanServerConnection interface to discover MBeans, attributes, and attribute types at runtime."

    That is why I used the example from the article by Rod and the BEA folks at this url:

    http://dev2dev.bea.com/pub/a/2005/09...ic_server.html

    (Notice the configuration on page 4).

    However, what the article doesn't tell you is how to configure an "exporter" in this environment. Setting the "server" property on the MBeanExporter to point to this MBeanServerConnectionFactoryBean yields a class cast at startup. What am I missing?

    Thanks all.
    Dan Hayes
    J2EE Architect
    http://www.mydogboris.com

  6. #6
    Join Date
    Aug 2004
    Location
    Philadelphia, PA, USA
    Posts
    17

    Default

    BTW,

    In my development environment, the username and passwords are the same so the fact that the property placeholders reference the same property don't make a difference to me. Also, I did catch the typo on 'principal'. It will error if you use 'principle'.

    Dan
    Dan Hayes
    J2EE Architect
    http://www.mydogboris.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •