Announcement Announcement Module
Collapse
No announcement yet.
A Messy Stew Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • A Messy Stew

    Hi all,

    I have a JSF application using Spring/Hibernate that runs on OAS/OC4J. Here is the mixture of technologies:

    Apache MyFaces 1.1.5
    Tomahawk 1.1.6
    Richfaces 3.1.6.GA
    Spring 2.5.5
    Hibernate 3.2.1
    OC4J 10.1.3.1
    Facelets 1.1.14

    I am trying to annotate one of my JSF managed beans for registration on the OC4J JMX MBean server, using Spring as the glue. The application starts up, and I see output from Spring saying 'applicationController' has been registered with the MBean server. However, when I try to view the MBean in the OC4J Admin Console, or view all the MBeans for the application, I see nothing, or I get an InvocationTargetException with no stack trace in the log output.

    WARNING Caught exception: java.lang.reflect.InvocationTargetException.

    Here is an excerpt of my Spring applicationContext.xml:
    Code:
    	<bean id="nterMBeanFactory" class="org.springframework.jmx.support.MBeanServerFactoryBean">
    		<property name="defaultDomain" value="nternet"/>
    	</bean>
    	<bean id="nterMBeanExporter" class="org.springframework.jmx.export.MBeanExporter">
    		<property name="server" ref="nterMBeanFactory"/>
    		<property name="autodetect" value="true"/>
    	        <property name="assembler" ref="assembler"/>
    	        <property name="namingStrategy" ref="namingStrategy"/>
    	</bean>
    	<bean id="annotationJmxAttributeSource"
    		class="org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource"/>
    	<bean id="namingStrategy"
              class="org.springframework.jmx.export.naming.MetadataNamingStrategy">
                <property name="attributeSource" ref="annotationJmxAttributeSource"/>
        </bean>
    	<bean id="assembler" class="org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler">
    	    <property name="attributeSource" ref="annotationJmxAttributeSource"/>
    	</bean>
    Here is an example of the annotations in my managed bean class:

    Code:
    &#64;ManagedResource(objectName="bean:name=ApplicationController", description="Application-Scope JSF Managed Bean")
    public class ApplicationController extends BaseController implements IInternetContentConstants {
        // ************************************************************************************************
        // JSF Action methods
        // ************************************************************************************************
        &#64;ManagedOperation(description="Refresh the Menu Structure")
        public String refreshWebAppMenu() {
            initializeMenuListFromFacade();
            return "";
        }
    
        &#64;ManagedOperation(description="Refresh the Store Locations Information")
        public String refreshLocationList() {
            initializeLocations();
            return "";
        }
    
    ...
    }
    I am unable to determine what the source of the error is, but I know OC4J is basically a piece of crap and doesn't play nice with lots of technology tools. I consider it practically a miracle I was able to get this application to run reliably in the first place, but want to get some JMX capabilities in there for obvious reasons.

    Anyone have any insight?
Working...
X