RE: [Mc4j-development] Does MC4J work with Tomcat
Brought to you by:
ghinkl
From: <mk...@gm...> - 2003-08-18 14:28:38
|
Greg, based on Tomcat 5.0.7 alpha and 4.1.27 I did all the steps you mentioned and didn't succeed. 2) was obsolete as it was already activated by default. 3) with tomcat 4.1.27 and 5.0.7 alpha there is no m4xj-tools.jar, but a mx4j-jmx.jar. Running against tomcat yielded the following error: *********** Exception occurred ************ at Mon Aug 18 15:37:00 CEST 2003 java.lang.ClassCastException at mx4j.connector.rmi.jrmp.JRMPConnector.narrow(JRMPConnector.java:28) at mx4j.connector.rmi.RMIConnector.connect(RMIConnector.java:72) [catch] at org.mc4j.console.connection.Mx4jConnectionNode.connect(Unknown Source) at org.mc4j.console.connection.ReconnectAction.performAction(Unknown Source) at org.openide.util.actions.NodeAction.performAction(NodeAction.java:179) at org.openide.util.actions.NodeAction.actionPerformed(NodeAction.java:170) at org.netbeans.core.ModuleActions$1.run(ModuleActions.java:104) at org.openide.util.Task.run(Task.java:136) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:599) I then copied the jmx4j-tools.jar in the mentioned directory, restarted server and mc4j, but got the same result... I also copied mx4j-jmx.jar from the mx4j installation, but got the same results. With 4.1.27 it was a different story. I didn't copy anything to tomcat and got the following results: *********** Exception occurred ************ at Mon Aug 18 15:45:44 CEST 2003 javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection re fused to host: localhost; nested exception is: java.net.ConnectException: Connection refused: connect] at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:92) at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:98) at javax.naming.InitialContext.lookup(InitialContext.java:347) at mx4j.connector.rmi.RMIConnector.connect(RMIConnector.java:70) at org.mc4j.console.connection.Mx4jConnectionNode.connect(Unknown Source) at org.mc4j.console.connection.ReconnectAction.performAction(Unknown Source) at org.openide.util.actions.NodeAction.performAction(NodeAction.java:179) at org.openide.util.actions.NodeAction.actionPerformed(NodeAction.java:170) at org.netbeans.core.ModuleActions$1.run(ModuleActions.java:104) at org.openide.util.Task.run(Task.java:136) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:599) Caused by: java.rmi.ConnectException: Connection refused to host: localhost; nested exception is: java.net.ConnectException: Connection refused: connect at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:567) at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185) at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171) at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:313) at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source) at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:88) ... 10 more Caused by: java.net.ConnectException: Connection refused: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158) at java.net.Socket.connect(Socket.java:452) at java.net.Socket.connect(Socket.java:402) at java.net.Socket.<init>(Socket.java:309) at java.net.Socket.<init>(Socket.java:124) at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:2 2) at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:1 28) at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562) [catch] ... 15 more ==> java.rmi.ConnectException: Connection refused to host: localhost; nested exception is: java.net.ConnectException: Connection refused: connect at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:567) at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185) at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171) at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:313) at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source) at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:88) at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:98) at javax.naming.InitialContext.lookup(InitialContext.java:347) at mx4j.connector.rmi.RMIConnector.connect(RMIConnector.java:70) at org.mc4j.console.connection.Mx4jConnectionNode.connect(Unknown Source) at org.mc4j.console.connection.ReconnectAction.performAction(Unknown Source) at org.openide.util.actions.NodeAction.performAction(NodeAction.java:179) at org.openide.util.actions.NodeAction.actionPerformed(NodeAction.java:170) at org.netbeans.core.ModuleActions$1.run(ModuleActions.java:104) at org.openide.util.Task.run(Task.java:136) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:599) Caused by: java.net.ConnectException: Connection refused: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158) at java.net.Socket.connect(Socket.java:452) at java.net.Socket.connect(Socket.java:402) at java.net.Socket.<init>(Socket.java:309) at java.net.Socket.<init>(Socket.java:124) at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:2 2) at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:1 28) at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562) [catch] ... 15 more So there is obviously nobody listening. This is what is in the console when Tomcat 4.1.27 starts: Starting service Tomcat-Standalone Apache Tomcat/4.1.27 18.08.2003 15:49:01 org.apache.struts.util.PropertyMessageResources <init> INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=tru e 18.08.2003 15:49:01 org.apache.struts.util.PropertyMessageResources <init> INFO: Initializing, config='org.apache.struts.action.ActionResources', returnNul l=true 18.08.2003 15:49:02 org.apache.struts.util.PropertyMessageResources <init> INFO: Initializing, config='org.apache.webapp.admin.ApplicationResources', retur nNull=true 18.08.2003 15:49:06 org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on port 8080 18.08.2003 15:49:06 org.apache.jk.common.ChannelSocket init INFO: JK2: ajp13 listening on /0.0.0.0:8009 18.08.2003 15:49:06 org.apache.jk.common.JkMX loadAdapter INFO: Creating Naming:name=rmiregistry 18.08.2003 15:49:06 org.apache.jk.common.JkMX loadAdapter INFO: Creating Adaptor:protocol=jrmp 18.08.2003 15:49:06 org.apache.jk.common.JkMX init INFO: Can't enable log4j mx 18.08.2003 15:49:06 org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=0/862 config=C:\JAKART~1.27\bin\..\conf\jk2.properti es I haven't seen there nor in the server.xml any reference to port 9000. I then copied the mx4j-tools.jar and got the following log when starting tomcat: 18.08.2003 15:54:33 org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on port 8080 18.08.2003 15:54:33 org.apache.jk.common.ChannelSocket init INFO: JK2: ajp13 listening on /0.0.0.0:8009 18.08.2003 15:54:33 org.apache.jk.common.JkMX loadAdapter INFO: Creating Naming:name=rmiregistry 18.08.2003 15:54:33 org.apache.jk.common.JkMX loadAdapter INFO: Creating Adaptor:protocol=jrmp 18.08.2003 15:54:33 org.apache.jk.common.JkMX init INFO: Can't enable log4j mx 18.08.2003 15:54:33 org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=0/812 config=C:\JAKART~1.27\bin\..\conf\jk2.properti es The result of the gui connect is as mentioned above: class cast exception ... etc. etc. netstat returned the following: kampma@XXX ~ $ netstat -a | grep 9000 TCP XXX:9000 0.0.0.0:0 LISTENING If you have a quick thought on this, pls let me know. If not, that's fine too. I was just toying around and it doesn't affect me too much if it is not working. Cheers, Mariano >from server.xml 4.1.27 <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 --> <Connector className="org.apache.coyote.tomcat4.CoyoteConnector" port="8009" minProcessors="5" maxProcessors="75" enableLookups="true" redirectPort="8443" acceptCount="10" debug="0" connectionTimeout="0" useURIValidationHack="false" protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/> > I found a message on one of the tomcat lists a few months ago with some > instructions for activating the JMX RMI connector. I tried it only > briefly, but it did connect. Let me know if you have any trouble. > > > (From Davanum Srinivas) > > Steps to setup MX4J (http://mx4j.sourceforge.net/) in Tomcat 4.1.24 > -------------------------------------------------------------------- > 1) Edit jk2.properties and add a line "mx.port=9000" > 2) Edit server.xml, enable the Connector under "Coyote/JK2 AJP 1.3 > Connector on port 8009" > 3) Copy mx4j-tools.jar from your MX4J distribution and copy it to > $CATALINA_HOME/server/lib directory. > 4) Start using "catalina run" - makes it easy to look for any > exceptions. > 5) Go to your MC4J bin directory, start runide.exe > 6) Switch to the tab that says "MC4J for MX4J" > 7) In the tree root node, right click and click on "Connect" > 8) Enter say tomcat4.1.24 in the wizard and click on finish. > 9) Expand the tree and browse the hierarchy. > > __ > Greg Hinkle > > > > -----Original Message----- > From: mk...@gm... [mailto:mk...@gm...] > Sent: Monday, August 18, 2003 7:34 AM > To: mc4...@li... > Subject: [Mc4j-development] Does MC4J work with Tomcat > > Hi, > > I searched the mail archives, but haven't seen this question already > been > asked. > > Does MC4J work with Tomcat? I believe Tomcat ist based on MX4J. So > this > should work, shouldn't it? Haven't been able to dig up an example > though.... > > I haven't found any references to a JMX related port in server.xml of > Tomcat. The only thing related to JMX was this: > > <!-- Comment these entries out to disable JMX MBeans support --> > <!-- You may also configure custom components (e.g. Valves/Realms) by > including your own mbean-descriptor file(s), and setting the > "descriptors" attribute to point to a ';' seperated list of paths > (in the ClassLoader sense) of files to add to the default list. > e.g. descriptors="/com/myfirm/mypackage/mbean-descriptor.xml" > --> > <Listener > className="org.apache.catalina.mbeans.ServerLifecycleListener" > debug="0"/> > <Listener > className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" > > debug="0"/> > > > Any ideas? > > Cheers, > Mariano > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01 > /01 > _______________________________________________ > Mc4j-development mailing list > Mc4...@li... > https://lists.sourceforge.net/lists/listinfo/mc4j-development > |