Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 93515 invoked from network); 18 Jul 2006 11:48:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 18 Jul 2006 11:48:34 -0000 Received: (qmail 59460 invoked by uid 500); 18 Jul 2006 11:48:21 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 59430 invoked by uid 500); 18 Jul 2006 11:48:21 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 59419 invoked by uid 99); 18 Jul 2006 11:48:21 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Jul 2006 04:48:21 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,RCVD_IN_BL_SPAMCOP_NET,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of jonmdickinson@googlemail.com designates 66.249.92.170 as permitted sender) Received: from [66.249.92.170] (HELO ug-out-1314.google.com) (66.249.92.170) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Jul 2006 04:48:20 -0700 Received: by ug-out-1314.google.com with SMTP id u40so409966ugc for ; Tue, 18 Jul 2006 04:47:58 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=googlemail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=WEWdwClHp5/a2VXIR7YmVn5MeXRjgZJpOucDWahomg8VRvSxVLK7RjZ3pYB4sQj3Gye1L1WRLbtC0ECcZ765pd/LicYPNxt7NCVtN4hHpf2DAhLJ/Nk85dyyU3teStBpqHxvGuklvTJYBnhfkMRoO+dCYHeYA5dMwel1zYFCxwI= Received: by 10.66.242.20 with SMTP id p20mr3561178ugh; Tue, 18 Jul 2006 04:47:58 -0700 (PDT) Received: by 10.66.218.1 with HTTP; Tue, 18 Jul 2006 04:47:58 -0700 (PDT) Message-ID: Date: Tue, 18 Jul 2006 12:47:58 +0100 From: "Jon Dickinson" To: users@tomcat.apache.org Subject: JMX Cluster invoke problems MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_80894_1494477.1153223278423" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_80894_1494477.1153223278423 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, I am trying to get my web application to send a message to the other nodes in the cluster. I am planning on using JMX to do this. So far I have been able to query all the information I need but I am unable to invoke the send command. I have followed the instructions in an earlier post with the subject "Cluster and notifications to nodes". In summary here they are again: a) mark application as priviliged=true b) define and implement your own ClusterMessage c) via MbeansServer you got the Catalina:type=Cluster,host=localhost mbean and send your operation ( send(ClusterMessage)). d) Register a ClusterListener. My version of step c looks like: Registry registry = Registry.getRegistry(null, null); MBeanServer server = registry.getMBeanServer(); ObjectName cluster = new ObjectName("simple-cluster:type=Cluster,host=localhost"); server.invoke(cluster, "send", new Object[] {new ClusterEventMessage()}, new String[] {" org.apache.catalina.cluster.ClusterMessage"}); I am using Tomcat 5.5.12. See below for the exception that I get: 2006-07-18 12:22:53,875 ERROR http-8090-Processor25 jmxtests.SendEventServlet - Cannot find method send with this signature javax.management.ReflectionException: Cannot find method send with this signature at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java :490) at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke( DynamicMetaDataImpl.java:213) at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java :220) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke( DefaultMBeanServerInterceptor.java:815) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java :784) at jmxtests.SendEventServlet.service (SendEventServlet.java:54) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter( ApplicationFilterChain.java :173) at org.apache.catalina.core.StandardWrapperValve.invoke( StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke( StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke ( StandardHostValve.java:126) at org.apache.catalina.cluster.tcp.ReplicationValve.invoke( ReplicationValve.java:247) at org.apache.catalina.valves.ErrorReportValve.invoke( ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke ( StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service( CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java :868) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection( Http11BaseProtocol.java:663) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket( PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt( LeaderFollowerWorkerThread.java :80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run( ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.NoSuchMethodException: org.apache.catalina.cluster.tcp.SimpleTcpCluster.send ( org.apache.catalina.cluster.ClusterMessage) at java.lang.Class.getMethod(Class.java:1581) at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java :484) ... 20 more Thanks, Jon. ------=_Part_80894_1494477.1153223278423--