Return-Path: Delivered-To: apmail-cxf-users-archive@www.apache.org Received: (qmail 47379 invoked from network); 24 Feb 2011 17:39:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Feb 2011 17:39:23 -0000 Received: (qmail 41856 invoked by uid 500); 24 Feb 2011 17:39:22 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 41528 invoked by uid 500); 24 Feb 2011 17:39:20 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 41518 invoked by uid 99); 24 Feb 2011 17:39:19 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Feb 2011 17:39:19 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of sapakiy@googlemail.com designates 209.85.214.169 as permitted sender) Received: from [209.85.214.169] (HELO mail-iw0-f169.google.com) (209.85.214.169) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Feb 2011 17:39:12 +0000 Received: by iwl42 with SMTP id 42so554645iwl.0 for ; Thu, 24 Feb 2011 09:38:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=1Ry9GtpsIwxSisF4/sZj8uATP2i1NFWilIoQZs8vl/k=; b=hKWs4+MxNp7uY+ZVbIcqujlnZf2YZRuVeybitpajKHEO84uBADsuLAiIdQp70NGcot bgVnI+zRkds7vpPmoDUz6vSId9Pyt7t3lm7etXxNgZJMQxtqvuOA6mSlCM/ohDr8fR7q YNPXffFvrmFG+/85S7IW7PwygSibkYYVxm+m8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=JAa+EGsnnvqkCG4jea85DONO50XaHjrjqwWq6Ub+Ryvx4Xkb0S+JORrUPzSh4yUcw2 L/kxlFwDR+0lLfPY5EWcUuNEwpIOEsDcckVYVlD2ntA5PgJUKeqfa+Sr/ByDRLOL5tcw gk9pv9abKkt0NGyltPt9B217v3lVGDpYpnrUM= MIME-Version: 1.0 Received: by 10.231.156.1 with SMTP id u1mr1838341ibw.52.1298569131503; Thu, 24 Feb 2011 09:38:51 -0800 (PST) Received: by 10.42.240.131 with HTTP; Thu, 24 Feb 2011 09:38:51 -0800 (PST) Date: Thu, 24 Feb 2011 18:38:51 +0100 Message-ID: Subject: Odd behavior in CXF's JMX InstrumentationManagerImpl From: Aki Yoshida To: users@cxf.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Hi, I am experimenting with the JMX instrumentaiton included in CXF in the standalone environment. It works fine with a single CXF bus file and I can see this bus showing up in the jconsole monitor. But when I use two bus files and setting parameter createMBServerConnectorFactory on one of the files to false, I expected to see two bus instances showing up in the monitor. However, I saw only the first one. So I looked into what is happening in org.apache.cxf.management.jmx.InstrumentationManagerImpl and probably found some issue. To explain, I need to quote the following code fragment (from 2.3.2, 2.3.x), which is in the init method of this class. if (mbs == null) { // return platform mbean server if the option is specified. if (usePlatformMBeanServer) { mbs = ManagementFactory.getPlatformMBeanServer(); } else { List servers = CastUtils .cast(MBeanServerFactory.findMBeanServer(mbeanServerName)); if (servers.size() <= 1) { mbs = MBeanServerFactory.createMBeanServer(mbeanServerName); } else { mbs = (MBeanServer)servers.get(0); } } } The intention of the code seems to retrieve the available server if it has been already created. However, MBeanserverFactory's createMBeanServer takes the domain name as the parameter (in this case, "org.apache.cxf"), whereas its findMBeanServer method takes the parameter agendId. And this value is not the domain name. So the above code does not find the instantiated server at the second time. As JMX's MBeanServerFactory stores the instantiated servers in its static map, I think CXF's InstrumentationManagementImpl should also use a static map to map each domain name to the agentID of the instantiated server so that the right parameter can be used for the find method. Along this line, I modified the code and now I can see the both bus instsances showing up in the monitor. But I am not sure if I understood the logic correctly or I am missing something. I would appreciate if someone could comment on this situation. Thanks. Regards, Aki