Return-Path: X-Original-To: apmail-activemq-users-archive@www.apache.org Delivered-To: apmail-activemq-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 42E4217F76 for ; Wed, 18 Mar 2015 20:37:01 +0000 (UTC) Received: (qmail 16976 invoked by uid 500); 18 Mar 2015 20:37:00 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 16932 invoked by uid 500); 18 Mar 2015 20:37:00 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 16919 invoked by uid 99); 18 Mar 2015 20:37:00 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Mar 2015 20:37:00 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS,T_FILL_THIS_FORM_SHORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jim.robinson@gmail.com designates 209.85.220.41 as permitted sender) Received: from [209.85.220.41] (HELO mail-pa0-f41.google.com) (209.85.220.41) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Mar 2015 20:36:36 +0000 Received: by pabyw6 with SMTP id yw6so52873548pab.2 for ; Wed, 18 Mar 2015 13:36:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=6pLqIlUCVmFcVQWK7YL9YHAVEfhtrhOEwFXNuVc+/WU=; b=UtjB9eW7eU5R0iwOeDWu6pm5PcUAXUMX/Kf9qFVnz1HO7x6mMblKah/1if7M5gv0CP +ZzmhnVxT7HaxL0ckeNzxtxglvNJ6RTRjecU7LQfV2dMkGtOjAwl9HCaoSkh+4VM81tK QHmOolq5YxWmmAivP51qIhVnjlsf8ZPIOav6MgOxKT9ToeG567YL5W/Z1v86S2NPCTb+ wLL/y1G/MyQ5M299/yo5eva6kQI+9RDMXRnlVK0aqsQ3bdidAC/j95C3IinhL4+Qzmn1 lHFMQBtis8505rUuWOMF9zmyYd1zZZ9QQp3HK9po9Ax8Syak4NtEGQTTlcthUoUIlcs7 6f1g== X-Received: by 10.66.141.109 with SMTP id rn13mr164808109pab.113.1426710994114; Wed, 18 Mar 2015 13:36:34 -0700 (PDT) MIME-Version: 1.0 Sender: jim.robinson@gmail.com Received: by 10.70.49.227 with HTTP; Wed, 18 Mar 2015 13:35:53 -0700 (PDT) In-Reply-To: <1426700946241-4693426.post@n4.nabble.com> References: <1426527939611-4693314.post@n4.nabble.com> <1426686071476-4693409.post@n4.nabble.com> <1426691849836-4693415.post@n4.nabble.com> <1426700946241-4693426.post@n4.nabble.com> From: "James A. Robinson" Date: Wed, 18 Mar 2015 13:35:53 -0700 X-Google-Sender-Auth: shvflLaYJHFX0lHjJncTjYa7ICQ Message-ID: Subject: Re: ActiveMQ 5.11 Dynamic Camel Route - Message Namespaces To: users@activemq.apache.org Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked by ClamAV on apache.org On Wed, Mar 18, 2015 at 10:49 AM, mtod wrote: > INFO | Created default XPathFactory > com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl@343985bd > INFO | Creating new XPath expression in pool. Namespaces on XPath > expression: [me: {system -> > http://camel.apache.org/xml/variables/system-properties},{env -> > http://camel.apache.org/xml/variables/environment-variables},{in -> > http://camel.apache.org/xml/in/},{function -> > http://camel.apache.org/xml/function/},{out -> > http://camel.apache.org/xml/out/}] > INFO | Namespaces discovered in message: > {xmlns:km=[http://xsdrepo.foundationmedicine.com/messaging/esb], > xmlns:xsi=[http://www.w3.org/2001/XMLSchema-instance], > xmlns:bm=[http://xsdrepo-dev.foundationmedicine.com/messaging/esbbamevent]}. Taking a look at this: http://camel.apache.org/maven/current/camel-core/apidocs/src-html/org/apache/camel/builder/xml/XPathBuilder.html the order of operations appears to be protected Object evaluateAs(Exchange exchange, QName resultQName) { ... xpathExpression = createXPathExpression(); ... logNamespaces(exchange); ... } where createXPathExpression() logs: LOG.trace("Creating new XPath expression in pool. Namespaces on XPath expression: {}", getNamespaceContext().toString()); before calling: xPath.setNamespaceContext(getNamespaceContext()); and that getNamespaceContext() result does not appear to contain your namespace. whereas logNamespaces(Exchange exchange) builds one of: answer = (NodeList) xpathExpression.evaluate(inputSource, XPathConstants.NODESET); answer = (NodeList) xpathExpression.evaluate(source.getNode(), XPathConstants.NODESET); answer = (NodeList) xpathExpression.evaluate(document, XPathConstants.NODESET); based on the input type and then calls logDiscoveredNamespaces(answer) which iterates over answer and apparently *does* contain your namespace. I would suspect this is a bug in what getNamespaceContext() is returning... Jim