PDA

View Full Version : Should Java-monitor enable JMX support in Jetty or not?


kjkoster
06-04-2009, 10:22
Dear All,

We are working to make Jetty servers be recognised by Java-monitor. This is a little more tricky than it sounds, because Jetty's JMX support has changed quite a bit between Jetty 5 and Jetty 6. In Jetty 7's prerelease there are even a few bugs with JMX support (http://jira.codehaus.org/browse/JETTY-976). On top of that, Jetty is embedded in the weirdest places (e.g. the Openfire XMPP server).

We're making good progress, through. The probe should be picking up on Jetty servers pretty soon.

By default, Jetty servers do not register any MBeans that we can use to extract Jetty server version numbers from. So the question is: is Java-monitor's probe allowed to change its environment in this way or not? Can the Java-monitor probe enable Jetty's MBean services if they are not enabled?

Right now, the Java-monitor probe is merely an observer. It looks at the given MBeans and works with what it is given. From a quality assurance and a security point of view that is a good thing, because I know for fact that the probe does not change anything.

Right now, the probe is also configuration free. You just drop it in and it works. I like that from a usability point of view. We have enough configuration to worry about to work an 80-hour week. No need to add more.

These two come in conflict over Jetty. Usability suggests that if not enabled, the probe should enable the MBeans for Jetty. QA and security balks at this, saying that it is an administrative decision to enable JMX and not up to the probe to decide.

What do you think? Should user friendliness overrule the other considerations in this case? Should the probe strictly be an observer in this case and work with what the administrators give it?

Kees Jan

Kees de Kooter
06-04-2009, 15:04
To obtain the server version you could call the static method org.mortbay.jetty.Server.getVersion()

In my opinion it is up to the administrator whether or not to enable JMX. Would not be hard to convince that person once he or she sees java-monitor ;)

kjkoster
06-04-2009, 15:22
Dear Kees,

Is there any way to determine what port numbers the Jetty service is running on? I need those to be able to support more than one Jetty per machine in Java-monitor.

Is this method available also when the Jetty code is loaded but not running? I've seen Jetty be dragged into projects as a dependency. This would make it appear as though Jetty was running too, even if it is not. :-/

Kees Jan

Kees de Kooter
07-04-2009, 08:30
You should somehow get a hold of the actual Server instance. Then you can call Server.getConnectors().

Nothing to be found in the servlet context attributes by the way.