Results 1 to 4 of 4

Thread: WebLogic Console Extension for Spring doesn't work !

  1. #1

    Question WebLogic Console Extension for Spring doesn't work !

    Greetings,

    Using WebLogic 10.3g on XP. It comes with an admin console extension dedicated to Spring. Upon deployment of a well configured webapp, the configuration tab of the admin conole displays a Spring Framework page supposed to display all the Spring beans registred with the MBean server through the Spring MBeanExporter.

    The problem is that, in my case, whatever I do, the Spring Framework page is empty, displaying "There are no items to display".

    I looked for a sample and, besides several different partial sample on the dev2dev site which don't work, I found on this site a sample reputated to have worked with WebLogic 9.2. Here is the Spring beans definition file:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
    <beans>
      <!-- The MBean server (as per WebLogic 10.3g) -->
      <bean id="mbeanServer" class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiName" value="java:comp/env/jmx/runtime"/>
      </bean>
      <!-- Expose properties and operations annotated in the source code -->
      <bean id="attributeSource" class="org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource"/>
      <!-- Use the annotations based ObjectName strategy, i.e. @ManagedResource(objectName="myApp:name=myService") -->
      <!-- bean id="namingStrategy" class="org.springframework.jmx.export.naming.MetadataNamingStrategy">
        <property name="attributeSource" ref="attributeSource"/>
      </bean-->  
      <!-- Use the annotation based assembler -->
      <!-- bean id="assembler" class="org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler">
        <property name="attributeSource" ref="attributeSource"/>
      </bean-->
      <bean id="assembler" class="org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler">
        <property name="attributeSource" ref="attributeSource"/>
      </bean>
      <bean id="consoleAdapter" class="com.interface21.wl9.jmx.mediator.Mediator">
        <property name="applicationName" value="bean"/>
      </bean>
      <bean id="bean01" class="fr.simplex_software.tests.Bean01"/>
      <!-- Export the annotated classes as model MBeans. They should appear in the JMX console -->
      <bean id="exporter" class="org.springframework.jmx.export.MBeanExporter" lazy-init="false">
        <property name="assembler" ref="assembler"/>
        <property name="server" ref="mbeanServer"/>
        <property name="autodetect" value="true" />
        <property name="autodetectModeName" value="AUTODETECT_ASSEMBLER"/>
        <!-- property name="namingStrategy" ref="namingStrategy"/-->
        <property name="beans">
          <map>
            <entry key="bean:name=testBean" value-ref="bean01"/>
          </map>
        </property>    
        <property name="listeners">
          <list>
            <ref bean="consoleAdapter"/>
          </list>
        </property>
      </bean>
    </beans>
    This file id almost identical with the one in the sample. The sample itself doesn't work with WebLogic 10.3g. There is no error message but, after deployment, the Spring Framework page contains no MBeans.

    The MBean server JNDI name for the 10.3g version is the same as the one in 9.2 (java:comp/env/jmx/runtime).

    I would like very much to solve this problem in order to be able to work with Spring beans in a JMX console, as I don't support anymore to handle dozens of XML files.

    Many thanks in advance for any pertinent help.

    Kind regards,

    Nicolas

  2. #2
    Join Date
    Apr 2009
    Posts
    1

    Default

    hi,

    anyone knows how to get mbean exposed in the spring extension console with weblogic 10.3 ?

    I even tried a war example that was supposed to work fine in weblogic 9 without any success.

    here's the xml spring:

    thanks !

    <?xml version="1.0" encoding="UTF-8"?>

    [...]

    <bean id="hello" class="com.springdeveloper.Hello">
    <property name="message" value="Spring People!!!"/>
    </bean>

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

    <bean id="assembler" class="org.springframework.jmx.export.assembler.Me tadataMBeanInfoAssembler">
    <property name="attributeSource">
    <bean class="org.springframework.jmx.export.annotation.A nnotationJmxAttributeSource"/>
    </property>
    </bean>

    <bean id="consoleAdapter" class="com.interface21.wl9.jmx.mediator.Mediator">
    <property name="applicationName" value="SpringWLS"/>
    </bean>

    <bean id="exporter" class="org.springframework.jmx.export.MBeanExporte r">
    <property name="beans">
    <map>
    <entry key="SpringBean:name=hello" value-ref="hello"/>
    </map>
    </property>
    <property name="assembler" ref="assembler"/>
    <property name="server" ref="mbeanServer"/>
    <property name="listeners">
    <list>
    <ref bean="consoleAdapter"/>
    </list>
    </property>
    <property name="autodetectModeName" value="AUTODETECT_MBEAN"/>
    </bean>

    </beans>

  3. #3

    Default

    have you guys figured how it works??

    does anyone knows how it works. i have tried everything still nothing shows in the console


    freeze dried maqui berry
    apple cider vinegar for acne
    Last edited by DebugMeNot; May 30th, 2011 at 08:41 PM.

  4. #4

    Default

    Hi
    You will be able to see all the spring beans, provided you put a proper context loader listener in the web.xml file.

    just put the following listener in the web.xml
    <listener>
    <listener-class>
    weblogic.spring.monitoring.WeblogicContextLoaderLi stener
    </listener-class>
    </listener>

    You need to add the weblogic-spring.jar as a dependency.

Posting Permissions

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