Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse Process Manager (Stardust) » JMX MBeans creation in Stardust(How to create a JMX MBeans using spring in Stardust)
JMX MBeans creation in Stardust [message #1563933] Wed, 14 January 2015 13:55 Go to next message
Kunal Suri is currently offline Kunal SuriFriend
Messages: 82
Registered: April 2013
Location: Paris Saclay, France
Member

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 #1565553 is a reply to message #1563933] Thu, 15 January 2015 10:48 Go to previous messageGo to next message
Andreas Mueller is currently offline Andreas MuellerFriend
Messages: 12
Registered: October 2011
Junior Member
Hi,

what problem are you exactly experiencing? There shouldn't be any difference in deploying MBeans on Tomcat with or without Stardust. I can only think of a class loading or 3rd party library conflict. Do you have a log file or anything else that would help to understand the actual problem?

Regards,

Andreas
Re: JMX MBeans creation in Stardust [message #1565722 is a reply to message #1565553] Thu, 15 January 2015 12:46 Go to previous messageGo to next message
Kunal Suri is currently offline Kunal SuriFriend
Messages: 82
Registered: April 2013
Location: Paris Saclay, France
Member

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 Go to previous messageGo to next message
Jan Hendrik Scheufen is currently offline Jan Hendrik ScheufenFriend
Messages: 77
Registered: October 2011
Member

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
Re: JMX MBeans creation in Stardust [message #1567451 is a reply to message #1565935] Fri, 16 January 2015 11:11 Go to previous messageGo to next message
Kunal Suri is currently offline Kunal SuriFriend
Messages: 82
Registered: April 2013
Location: Paris Saclay, France
Member

Hi Jan,

Thanks for the insight.

I was already using a custom Jar and I added this spring code to it as you had mentioned and the JMX code worked fine for me. Smile

Cheers,
Kunal.
Re: JMX MBeans creation in Stardust [message #1572601 is a reply to message #1567451] Mon, 19 January 2015 08:20 Go to previous message
Robert Emsbach is currently offline Robert EmsbachFriend
Messages: 186
Registered: October 2011
Location: Singapore
Senior Member

Great, Kunal. Please let us know in case this experiment leads to something that would be useful in general. If other use cases would profit form it as well then we could add it to Stardust.

Best regards

Rob
Previous Topic:Assign specific account as current user
Next Topic:Test Data for Report testing
Goto Forum:
  


Current Time: Tue Nov 13 15:37:14 GMT 2018

Powered by FUDForum. Page generated in 0.02631 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top