0 Replies Latest reply on Feb 13, 2012 1:44 PM by Robert Smith

    Creating MBeans in a portlet

    Robert Smith Newbie

      Hi all,

      I'm wondering if anyone has attempted to create a managed bean within a portlet? Our application needs the ability to do some monitoring and property setting on the fly and we thought using JMX would be a good solution.

      I've been investigating JMX and haven't had much luck.

      We are running on JBoss 5.1.0, Liferay EE 6.0 Portal,  and using ICEfaces and Spring. I've attempted to use Spring to create a managed bean and also attempted to do it by creating a sar.

      When I used Spring, it seems to work as it compiles and deploys, but the MBean is not visible in the JBoss jmx-console or in JConsole.

      When I used the sar approach, I tried 2 methods. First, I created a separate project that generated a .sar file with a META-INF directory containing the jboss-service.xml. On deployment, it failed with classpath errors. I'm assuming that is because the sar is not in an ear with the portlet webapp, hence the classpath is just JBoss which doesnt contain the portlet classpath.

      Next, I tried adding the jboss-service.xml in the META-INF directory of the portlet war. That too appeared to work fine, except as with Spring the MBean is not visible in the JBoss jmx-console or JConsole.

      I'm starting to run out of ideas, and I'm not finding much information about creating JMX MBeans within portlets.