Return-Path: X-Original-To: apmail-qpid-users-archive@www.apache.org Delivered-To: apmail-qpid-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 954EFD95E for ; Fri, 19 Oct 2012 14:01:43 +0000 (UTC) Received: (qmail 43783 invoked by uid 500); 19 Oct 2012 14:01:43 -0000 Delivered-To: apmail-qpid-users-archive@qpid.apache.org Received: (qmail 43493 invoked by uid 500); 19 Oct 2012 14:01:42 -0000 Mailing-List: contact users-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@qpid.apache.org Delivered-To: mailing list users@qpid.apache.org Received: (qmail 43439 invoked by uid 99); 19 Oct 2012 14:01:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Oct 2012 14:01:40 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.223.170] (HELO mail-ie0-f170.google.com) (209.85.223.170) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Oct 2012 14:01:32 +0000 Received: by mail-ie0-f170.google.com with SMTP id c12so598994ieb.15 for ; Fri, 19 Oct 2012 07:01:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type :x-gm-message-state; bh=sSs9mdCRbHvMjvpTBskkiNI/dWpElTyC4cRBCDomXJE=; b=bFpqBAV1iExIl3/nKC7YZ9Q/1W+CIJRPC4lNFIlFWD1F1lj//TZZ6hMB9sCSd+rO8c xpuLIlC2UKC2jGvoQYF91ua0ybrudKzGhE7GemmKC4p6d0sQz+BYMwSLwlPqQZu2oIy1 ZBHW6p4YehcE51ZZOvivuk0bRr9z43iVxZi2gl0tgtyzhvu2kg7XxNGF/Aap1zTMIla2 ZvTo11U55F2qIMCrep0PHSQjd2M8aILJ7Khq+SATFSfX/8aMD2/es2D9DVcAKKIujY/R ih5Smu100KQy+he/1mMgBIK608TB2R5+wwWCj2jHBqJWfuyGHtOZ/KJrvfF5BUn6qR4S lOBQ== MIME-Version: 1.0 Received: by 10.50.194.132 with SMTP id hw4mr1364770igc.35.1350655270505; Fri, 19 Oct 2012 07:01:10 -0700 (PDT) Received: by 10.50.6.233 with HTTP; Fri, 19 Oct 2012 07:01:10 -0700 (PDT) Date: Fri, 19 Oct 2012 10:01:10 -0400 Message-ID: Subject: Call qpid jmx from ear deployed in JBoss7.1.2Final From: Joey Daughtery To: users@qpid.apache.org Content-Type: multipart/alternative; boundary=14dae93411e99ccdce04cc69ef0e X-Gm-Message-State: ALoCoQl9mJv05Hz12csFI75yqOjvQf874TVmgBMU7HomZvYaFt7ncg0qm96wPZS/o8vlp447oah7 X-Virus-Checked: Checked by ClamAV on apache.org --14dae93411e99ccdce04cc69ef0e Content-Type: text/plain; charset=ISO-8859-1 All The following code when ran in a main method runs as expected. However, when I put the code inside an ear and call it via a webservice endpoint, I get the exception below. Appears that jboss is interpreting the url as if the code is attempting to connect to the jboss service. I was thinking that because qpid is listening on port 8999, that jboss would hit that port, there by triggering the jmx lookup on qpid. Exception: Failed to retrieve RMIServer stub: javax.naming.NameNotFoundException: rmi://localhost:8999/jmxrmi -- service jboss.naming.context.java.rmi:.localhost:8999.jmxrmi"} Code: private static void main() { String[] attributes = new String[]{"Name", "Owner", "ActiveConsumerCount", "AutoDelete", "Capacity", "ConsumerCount", "Description", "Durable", "Exclusive", "FlowOverfull", "FlowResumeCapacity", "MaximumDeliveryCount", "MaximumMessageAge", "MaximumMessageCount", "MaximumMessageSize", "MaximumQueueDepth", "MessageCount", "QueueDepth", "QueueType", "ReceivedMessageCount"}; try { Map environment = new HashMap(); // credentials: user name and password environment.put(JMXConnector.CREDENTIALS, new String[]{"admin", "admin"}); JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:8999/jmxrmi"); JMXConnector jmxConnector = JMXConnectorFactory.connect(url, environment); MBeanServerConnection mbsc = jmxConnector.getMBeanServerConnection(); String[] domains = mbsc.getDomains(); for (int k = 0; k < domains.length; k++) { String domain = domains[k]; ObjectName queueObjectName = new ObjectName(domain + ":*"); Set nameSet = mbsc.queryNames(queueObjectName, null); Iterator it = nameSet.iterator(); while (it.hasNext()) { ObjectName n = (ObjectName) it.next(); //System.out.println(n.getCanonicalName() + ": " + n.getKeyPropertyListString()); ObjectName queueObjectName2 = new ObjectName(domain+":"+n.getKeyPropertyListString()); Iterator it2 = mbsc.getAttributes(queueObjectName2, attributes).asList().iterator(); System.out.println("########################NEXT DOMAIN: "+domain+":"+n.getKeyPropertyListString()); while (it2.hasNext()) { Attribute att = (Attribute) it2.next(); System.out.println("attribute: "+att.getName() + " value: " + att.getValue()); } } } } catch (Exception e) { e.printStackTrace(); } } Thanks Joe --14dae93411e99ccdce04cc69ef0e--