Return-Path: X-Original-To: apmail-camel-issues-archive@minotaur.apache.org Delivered-To: apmail-camel-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 82D051082F for ; Wed, 18 Dec 2013 22:25:07 +0000 (UTC) Received: (qmail 351 invoked by uid 500); 18 Dec 2013 22:25:07 -0000 Delivered-To: apmail-camel-issues-archive@camel.apache.org Received: (qmail 307 invoked by uid 500); 18 Dec 2013 22:25:07 -0000 Mailing-List: contact issues-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list issues@camel.apache.org Received: (qmail 299 invoked by uid 99); 18 Dec 2013 22:25:07 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Dec 2013 22:25:07 +0000 Date: Wed, 18 Dec 2013 22:25:07 +0000 (UTC) From: "Rene Avontuur (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CAMEL-6922) XmlConverter cannot convert from ElementNSImpl to Document MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CAMEL-6922?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Rene Avontuur updated CAMEL-6922: --------------------------------- Attachment: NodeListToDocumentTest.java I wrote a unit test for this issue, which is attached as NodeListToDoumentTest.java. It shows that ElementNSImpl implements the NodeList interface, the responsible superclass is NodeImpl. This unit test passes on my machine, running an Oracle JDK. The same unit test fails, after making the following change in class BaseTypeConverterRegistry: // try the interfaces (in reverse order) for (int i=fromType.getInterfaces().length-1;i>=0;i--) { Class type = fromType.getInterfaces()[i]; instead of: // try the interfaces for (Class type : fromType.getInterfaces()) This may explain why a different JDK may have an issue with this conversion. > XmlConverter cannot convert from ElementNSImpl to Document > ---------------------------------------------------------- > > Key: CAMEL-6922 > URL: https://issues.apache.org/jira/browse/CAMEL-6922 > Project: Camel > Issue Type: Bug > Components: camel-core > Affects Versions: 2.11.2 > Environment: HP-UX, JDK 6.14, 7.06 > Reporter: Arseniy Tashoyan > Priority: Minor > Labels: converter, dom, xml > Attachments: NodeListToDocumentTest.java > > > XmlConvertor cannot convert from org.apache.xerces.dom.ElementNSImpl to org.w3c.dom.Document. Class ElementNSImpl implements both interfaces org.w3c.dom.Node and org.w3c.dom.NodeList. While type converter lookup iterates from ElementNSImpl through it's superclasses and implemented interfaces, it reaches NodeList first. Therefore the > {color:green} > Node toDOMNodeFromSingleNodeList(NodeList) > {color} > method is selected for conversion. However this method returns null for any NodeList with more than one node. This leads to null in a message's body. > This issue is not detected on Linux, because on Oracle JDK lookup reaches Node before NodeList and the > {color:green} > Document toDOMDocument(Node) > {color} > method is selected for conversion. -- This message was sent by Atlassian JIRA (v6.1.4#6159)