2

Would JMX work for java applications which are no way web related, but act as game servers? Or do I need to have a web app to run and connect to JMX and be able to monitor my java application? [check this question for that case] So confusing..

Community
  • 1
  • 1
Rihards
  • 10,241
  • 14
  • 58
  • 78
  • JMX queues and topics can be found with JNDI and typical implementations of them exist in an EJB container. Your application servers like JBoss and Glassfish are EJB containers but they are also servlet containers as well (web application servers). I assume what you mean by "game server" is that their will be client processes that make a network connection but you don't want the overhead of HTTP and Servlets? – maple_shaft May 11 '11 at 15:12
  • @maple_shaft, well basically the game server is a server where users connects to and listens for what server says (for multi user game) but yea it doesn't have any http.. – Rihards May 11 '11 at 15:14

2 Answers2

4

JConsole and VisualVM use JMX and can connect to any Java process.

A web server would make no difference.

Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130
  • Oh, okay. Thanks! That makes it a little less confusing. Now just to figure out the connection problem. – Rihards May 11 '11 at 15:13
  • 1
    Try running JConsole as the same user on the same host as your application and it should find it automagically so you can connect to it. – Peter Lawrey May 11 '11 at 15:14
  • how do I run jconsole on my server? – Rihards May 11 '11 at 15:22
  • Login to the server as the user running the process. Start you favourite remote desktop access program like Windows Remote Desktop, VNC, NoMachine or XServer and run jconsole using that application. – Peter Lawrey May 11 '11 at 15:24
  • If you don't have any Graphical interface on the server, no X Windows etc, you can run tools like jstat which use JMX, but have a text output. – Peter Lawrey May 11 '11 at 15:25
0

No, you don't need a web application in order to connect to JMX. You can use jconsole coming with JDK or other tools.

Tarlog
  • 10,024
  • 2
  • 43
  • 67