Community   SpringSource   Projects    Downloads    Documentation    Forums    Training   Exchange   Blogs

Go Back   Spring Community Forums > Core Spring Projects > Spring Management

Reply
 
Thread Tools Display Modes
  #1  
Old Oct 22nd, 2009, 07:18 AM
omartin omartin is offline
Junior Member
 
Join Date: Jan 2006
Posts: 10
Default AMS : JMX communication with JBoss 4.3

Hello,

I'm trying to import via JMX the metrics JMX metrics from the embedded Tomcat6 webapps. I use an instrumented version of Spring and thus would like to import it into AMS.

Specifically I'm having the following error from the agent :

Code:
ERROR [Thread-0] [MeasurementCommandsServer] Error getting real time measurement: Invalid request: Can't initialize remote connector: Invalid JMX URL port: rmi
With the jmxUrl :
Code:
service:jmx:rmi:///jndi/rmi://localhost:10777/jmxrmi
This URL works perfectly fine with JConsole, the URL format looks correct according to the AMS documentation. I really can't understand this error.

I'm using those products :
* AMS Version 2.0.0.SR02 (build #677 - Aug 06, 2009 - )
* JBoss 4.3-CP04, started with these parameters :
Code:
-Dcom.sun.management.jmxremote.port=10777 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false

Let me know if you need more details.

Thanks!
Reply With Quote
  #2  
Old Oct 23rd, 2009, 02:14 AM
omartin omartin is offline
Junior Member
 
Join Date: Jan 2006
Posts: 10
Default

OK I really don't get it, the jmxUrl seems fine with something like http://localhost:8080 (so I assume it gets info from the monitoring servlet) but yields an error with an URL like service:jmx:rmi... which is exactly what is specified in the documentation !

I can only monitor my webapps, I don't get any JMX related info.

Any clue ?
Reply With Quote
  #3  
Old Oct 24th, 2009, 11:06 AM
jencompgeek jencompgeek is offline
Member
 
Join Date: Jan 2006
Posts: 30
Default

The JMX metrics from your instrumented Spring app should show up under the JBoss server, not the embedded Tomcat. We recently discovered that you must perform the following workaround to enable AMS or HQ to discover these MBeans in JBoss:

JBoss converts ModelMBeans when they are deployed to the MBeanServer. The fastest way to fix this is to edit JBOSS_HOME/server/default/deploy/jmx-invoker-service.xml by commenting out the following entry towards the bottom of the file:

<!-- Interceptor that deals with non-serializable results -->
<!--><interceptor code="org.jboss.jmx.connector.invoker.Serializable Interceptor"
policyClass="StripModelMBeanInfoPolicy"/> -->

I apologize for the inconvenience. We are working on resolving this in a future HQ release.
Reply With Quote
  #4  
Old Oct 27th, 2009, 08:06 AM
omartin omartin is offline
Junior Member
 
Join Date: Jan 2006
Posts: 10
Default

Thanks jencompgeek for your answer, but I still can't make it work...

It's fine with tc Server (of course) : I can see my Spring Web application and monitor it but no luck with JBoss.

So far I've tested and failed with all those versions :
- JBoss 4.0.5
- JBoss 4.2.2
- JBoss 4.3 CP04

I'm not sure what should I do next to find out what's wrong.
Reply With Quote
  #5  
Old Oct 27th, 2009, 10:29 AM
jencompgeek jencompgeek is offline
Member
 
Join Date: Jan 2006
Posts: 30
Default

Try starting JBoss without the -Dcom.sun.management.jmxremote.port=10777, etc. AMS uses JNP to connect to the JBoss MBeanServer (those jmxremote props are not used). I've heard someone else say recently that they couldn't access the Spring MBeans when they added the above sys props in JBoss, but once they took them out it worked. I haven't had a chance to look into it yet. If you take the jmxremote props out, you should still see MBeans in the "spring.application" domain from the JBoss JMX Console. Assuming you see them there, AMS should pick them up once you restart the agent.
Reply With Quote
  #6  
Old Oct 27th, 2009, 11:28 AM
omartin omartin is offline
Junior Member
 
Join Date: Jan 2006
Posts: 10
Default

Hmm I dont see the spring.application domain in the JBoss' JMX console this could be it, thanks for the tip I'm gonna investigate.
Reply With Quote
  #7  
Old Oct 28th, 2009, 04:06 AM
omartin omartin is offline
Junior Member
 
Join Date: Jan 2006
Posts: 10
Default

@jencompgeek you rock!

Activating the remote JMX options on the JVM indeed prevented the spring.application MBean to show up in JBoss' JMX console. It works now.

Last question : how should I add a new "Sun JVM 1.5" server now that I removed the JMX exposition ?
Reply With Quote
  #8  
Old Mar 27th, 2010, 05:25 AM
sheenashirley sheenashirley is offline
Junior Member
 
Join Date: Mar 2010
Posts: 1
Default hiii

If you take the jmxremote props out, you should still see MBeans in the "spring.application" domain from the JBoss JMX Console. Assuming you see them there, AMS should pick them up once you restart the agent.
Reply With Quote.

emergency plumber
Reply With Quote
  #9  
Old Apr 3rd, 2010, 04:48 AM
marrydavidson101 marrydavidson101 is offline
Junior Member
 
Join Date: Apr 2010
Posts: 2
Default

very nice informative post my one of best friend refer me to this forum and i found it the best
__________________
get 70-646 and 70-647 certified 70-648 and
70-649
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 02:56 AM.


Contegix provides first-class managed hosting and partial sponsorship of these forums.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.