Slobodan Vujasinovic wrote:
I'm member of 'Enhydra Development Team' and we are currently developing Application Server (Enhydra-Lite) based on Tomcat5.0.
I'm developing a side tool (EnTray - system tray administration tool (used for starting/stopping server actions, accessing deployed applications, etc)) that communicates with Tomcat (its MBeanServer) using JMX and gathers information from/about registered MBeans.
As I understood Tomcat 5.0.x offers possibility of "Complete server monitoring using JMX and the manager web application" which is OK (I downloaded "jmx.browser-1.2.0" application from Source Forge which enabled me to se all registered MBeans).
But, I need to establish communication with Tomcat thru rmi/jrmp protocol (from diferent virtual mashine).
I stumbled upon some configuration parameters on JK2 Home Page ( http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk2/configweb.html).
Parameters are: mx.enable, mx.httpPort, mx.httpHost, mxjrmpPort (probably typing error, I assume mx.jrmpHost is meant to be here) and mx.jrmpPort.
After integration of "mx4j" (2.0.1 release) into Tomcat I had no problems with communication thro HTTP, but JRMP could not be initialized because class "mx4j.adaptor.rmi.jrmp.JRMPAdaptor" was not found (probably some older mx4j implementation - in new versions this class is placed in "mx4j.tools.adaptor.rmi.jrmp" package). I even stumbled, on tomcat users mailing list, on some additional configuration parameters (!!???) that enable configuration of Adapter classes that are going to be initialized (mx.mx4jHttpAdaptorClassName and mx.mx4jJRMPAdaptorClassName), but that didn't work eider.
After, repackaging of "JRMPAdaptor" (from "mx4j.adaptor.rmi.jrmp" to "mx4j.tools.adaptor.rmi.jrmp") I've succeeded to establish communication between "EnTray" and Tomcat, and everything looked just fine - until I tried to shutdown the server.
I've got "Stoping JMX" log on console and server could not finish shutdown process.
To resolve this problem I had to take a look at Tomcats source code (downloaded actual release 5.0.27) and found class of my interest ("org.apache.jk.common.JkMX" - placed in 'jakarta-tomcat-connectors' module).
Problem was in "destroy()" method where You are trying to stop "jrmpServerName" ("mx4j.tools.naming.NamingService") and not
actually initialized "adaptor" ("mx4j.adaptor.rmi.jrmp.JRMPAdaptor").
Fatherly, I' ve changed JRMAdaptor initialization (in the same class) by adding "mx4j.tools.adaptor.rmi.jrmp.JRMPAdaptor" (latest implementation of mx4j) implementation option ("mx4j.tools.adaptor.http.HttpAdaptor" and "mx4j.adaptor.http.HttpAdaptor" options already existed there).
I'm sending adapted JkMX.java file ("org.apache.jk.common.JkMX"
implementation) and I hope that You will be so kind to consider those
changes and to include them in next Tomcat release (I understand that "This
is very experimental" - but is the matter of great importance to me).
We got more elegant code contributed already. http://issues.apache.org/bugzilla/show_bug.cgi?id=29259
I expect that code will be included in 5.0.x eventually. OTOH, JMX server startup code shouldn't be in the connector code, so it'll be removed from JK.
Rémy
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]