JMX MBeans creation in Stardust [message #1563933] |
Wed, 14 January 2015 13:55 |
|
Hello,
I would kindly request for some guidance regarding creation of JMX MBeans in Stardust.
For some experimentation, I would like to create an MBean that could easily relays the data about Stardust events like the activity related data using SPI monitoring approach i.e. org.eclipse.stardust.engine.core.spi.monitoring.IActivityInstanceMonitor
and can be read using JConsole or any other JMX client. (extension of thread [1])
I am able to create MBeans and see the same using JConsole in non stardust projects with Tomcat using Spring and would like to do the same in Stardust.
Looking forward for your help!
Thanks in Advance!
Kunal.
P.S.
[1] http://www.eclipse.org/forums/index.php/t/551904/
|
|
|
|
Re: JMX MBeans creation in Stardust [message #1565722 is a reply to message #1565553] |
Thu, 15 January 2015 12:46 |
|
Hi,
The problem I am facing is the following:
1. I am not sure in which *.xml (spring) file I should put my MBean initiation code.
I tired to put my simple code to "stardust-spring-context.xml" file but it just gives an error signal.
<context:component-scan base-package="com.xrce.dsm.mbeans" />
<context:mbean-export server="mbeanServer" />
<bean id="mbeanServer" class="java.lang.management.ManagementFactory"
lazy-init="false" factory-method="getPlatformMBeanServer">
</bean>
Note:
I am using 2.1.0 Stardust for a test project and am deploying the same on Tomcat 7.0.57.
I have enabled the tomcat with following code to start displaying the MBeans once initiated.
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=9090
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
I hope I am able to give a better picture of my problem!
Thanks,
Kunal.
[Updated on: Thu, 15 January 2015 12:48] Report message to a moderator
|
|
|
Re: JMX MBeans creation in Stardust [message #1565935 is a reply to message #1565722] |
Thu, 15 January 2015 15:22 |
|
Hi Kunal,
to achieve a high separation of custom code or config we recommend not adjusting any files that came with Stardust, but putting your own Java code and Spring configuration in its own JAR that is then added to the WAR.
You may already one (or more) custom JARs, not sure ...
Per convention Stardust looks into all JARs on the classpath and searches for Spring config file with the following pattern: /META-INF/spring/*-context.xml
So, if you put your JMX bean setup in a file inside your custom JAR under, for example: /META-INF/spring/kunals-jmx-context.xml and add the JAR to the web application's WEB-INF/lib/ folder (or include it as dependency in a Maven build) Stardust will find your Spring config and include it into the global ApplicationContext.
I hope this helps.
Jan
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03211 seconds