• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with JMX

 
Siddharth Bhargava
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Everybody,
I have written a very simple jmx program. The code is as under.

HelloMBean


Hello


SimpleAgent


The code compiles fine and I run the program SimpleAgent with the commandline option java -Dcom.sun.management.jmxremote SimpleAgent. But when I connect to jmx agent using jconsole tool, it dosen't display any local processes to be monitored.


Why is this happening ?. Please tell me where I am going wrong.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's odd. Are you starting jconsole after SimpleAgent, or at least trying to connect after it's been started? If jconsole is already running, and showing the "Connect to agent" dialog, then it won't pick up newly started processes.
 
Siddharth Bhargava
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah I am starting JConsole after running SimpleAgent program. Do I have to start jconsole before running the simpleagent program. Please guide me.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, if jconsole is started after SimpleAgent, then it should list it right away.
 
Siddharth Bhargava
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

No, if jconsole is started after SimpleAgent, then it should list it right away.


Yeah I am doing that only .... starting jconsole after starting simpleagent.. but jconsole isn't showing up anything ....
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic