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

  • dan19460
    started a topic JMX in Weblogic 9

    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.

  • nicolasduminil
    replied
    It didn't change since the 9th version. However, this sample reputated as working in 9 doesn't work in 10.3g. Accordingly, either it didn't work in 9, or it worked in 9 and, due to others inter-version changements than the MBean server JNDI name which is the same as previously, it doesn't work any more. So, I'm asking the question: supposing that the sample has worked in 9, does anyone know how to get it working in 10.3.

    Many thanks in advance for any help.

    Nicolas

    Leave a comment:


  • jonnio
    replied
    The MBean server is available in most version of weblogic starting with 6. The trick is to discover the jndi address of the mbean server. It has changed througout the versions.

    Leave a comment:


  • nicolasduminil
    replied
    What about WebLogic 10.3g ?

    Originally posted by trisberg View Post
    I used a running example for a presentation I gave earlier this year. Take a look at http://www.springdeveloper.com/psug/meeting.html

    There is also a downloadable zip file with code for this example - see http://www.springdeveloper.com/psug/bea-spring.html

    This was all deployed on WLS 9.1
    Having deployed this WAR in WebLogic 10.3g, the Spring Framework is empty and displays "There are no items to display". Any clue please ?

    Many thanks in advance.

    Nicolas

    Leave a comment:


  • mic
    replied
    JndiObjectFactoryBean for Weblogic 8?

    hi,
    more or less on this issue...:
    I understand that JndiObjectFactoryBean can be used with Weblogic9, but what about Weblogic 8?
    MUST I use WeblogicJndiMBeanserverFactoryBean if I've got WLS 8?

    thanks,

    Leave a comment:


  • abhirai
    replied
    Thanks

    Thanks for your example, it works like a gem. On dev2dev site these things hasnt been mentioned the extra configuration settings that needs to be done !!! Someone from BEA has to update it.

    Cheers
    Abhijeet Rai

    Leave a comment:


  • trisberg
    replied
    I used a running example for a presentation I gave earlier this year. Take a look at http://www.springdeveloper.com/psug/meeting.html

    There is also a downloadable zip file with code for this example - see http://www.springdeveloper.com/psug/bea-spring.html

    This was all deployed on WLS 9.1

    Leave a comment:


  • abhirai
    replied
    Hi ,

    Facing the same issue with Spring 1.2.5 on WLS9.0, "Spring Management Objects" Tab is visible for the webApp that has been configured for the plugin. But When clicking on the tab gives a message "No Spring MBeans Registered" message.

    Am I missing something with the configuration or is it the problem with the plug-in itself ?

    Any pointers will be appreciated.

    Cheers
    Abhijeet Rai

    Leave a comment:


  • abhirai
    replied
    No Spring MBeans Registered.

    Hi ,

    Facing the same issue with Spring 1.2.5 on WLS9.0, "Spring Management Objects" Tab is visible for the webApp that has been configured for the plugin. But When clicking on the tab gives a message "No Spring MBeans Registered" message.

    Am I missing something with the configuration or is it the problem with the plug-in itself ?

    Any pointers will be appreciated.

    Cheers
    Abhijeet Rai

    Leave a comment:


  • dan19460
    replied
    Thanks Rob. This is a heck of alot easier. It now appears as though the exporter is using the Weblogic MBean Server (referenced via JNDI) -- yeah! I say this because the log debug messages indicate that the 'poppeourri:service=hibernateStatistics' has been autodetected and subsequently registered with the JMX server. I no longer get the message that "a JMX server could not be found -- creating new MBean server". All is well.... but wait.

    Unfortunately, when I access the "Spring Managed Beans" tab for this web application exposed via the new WL console plug-in I still see "No Spring MBeans Registered". Do you know anything about this plug-in? Shouldn't I see the hiberate statistics service here?

    Thanks again for your help.

    Dan.

    Leave a comment:


  • robh
    replied
    WebLogic Server 9 exposes its MBeanServer via JNDI and it can be accessed quite easily now using a plain JndiObjectFactoryBean. This is different from the WLS 8.1 setup which requires one for the special WeblogicMBeanServer*FactoryBean implementations.

    The required configuration is:

    <bean class="org.springframework.jndi.JndiObjectFactoryB ean">
    <property name="jndiName" value="java:comp/env/jmx/runtime"/>
    </bean>


    Regards,

    Rob

    Leave a comment:


  • dan19460
    replied
    More information.... With the following configuration:

    Code:
        <!-- Hibernate 3.0's JMX statistics service -->
        <!-- Implements the StatisticsServiceMBean management interface -->
        <bean name="poppeourri:service=hibernateStatistics" class="org.hibernate.jmx.StatisticsService" >
            <property name="sessionFactory" ref="sessionFactory"/>
        </bean>
        <!-- ========================= JMX EXPORTER DEFINITION ========================= -->
    
        <bean id="exporter" class="org.springframework.jmx.export.MBeanExporter" >
            <property name="autodetect" value="true"/>
            <property name="server" ref="mbeanServer"/>
        </bean>
    
        <bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean">
            <property name="locateExistingServerIfPossible" value="true"/>
        </bean>
    
        <!-- expose weblogic server's runtime mbeanserver connection -->
        <bean id="runtimeMbeanServerConnection"
                class="org.springframework.jmx.support.MBeanServerConnectionFactoryBean" >
            <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_PASSWORD}</prop>
                    <prop key="jmx.remote.protocol.provider.pkgs">weblogic.management.remote</prop>
                </props>
            </property>
        </bean>
    .... everything deploys without error. Unfortunately, the mbeanServer bean does not find the Weblogic MBean server and therefore creates a new one. The hibernate statistics mbean (in this example) IS being registered with this newly created MBean server. This does me little good as I am planning to demonstrate the Spring Managed Beans console plug-in which looks at the built in Weblogic MBean server. Right now the console says "There are no Spring managed beans"....

    Dan.

    Leave a comment:


  • dan19460
    replied
    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

    Leave a comment:


  • dan19460
    replied
    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.

    Leave a comment:


  • trisberg
    replied
    Also, shouldn't it be
    Code:
    java.naming.security.principal

    Leave a comment:

Working...
X