Petals ESB Container

ClassCastException when using another Document implementation than JDK's default and using DOMSource for new NormalizedMessage

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 5.0.2
  • Fix Version/s: 5.1.0
  • Component/s: Micro-kernel
  • Security Level: Public
  • Description:
    Hide

    Even though other implementations than Xerces 2.7.1 embedded in Java 7 for dom Document, if one use another one (for example a more recent version of xerces, but any other too), when creating a NormalizedMessage with a DOMSource, users can see this kind of exception:

    java.lang.ClassCastException: org.apache.xerces.dom.ElementNSImpl cannot be cast to com.sun.org.apache.xerces.internal.dom.NodeImpl
    	at org.ow2.petals.jbi.messaging.exchange.impl.NormalizedMessageImpl.makeReadOnly(NormalizedMessageImpl.java:194)
    	at org.ow2.petals.jbi.messaging.exchange.impl.NormalizedMessageImpl.setContent(NormalizedMessageImpl.java:142)
    	at org.ow2.petals.component.framework.message.ExchangeImpl.setOutMessageContent(ExchangeImpl.java:736)

    The problem is coming from the assumption in our code that the implementation when creating new Document is the one from the JDK, which is wrong.

    Show
    Even though other implementations than Xerces 2.7.1 embedded in Java 7 for dom Document, if one use another one (for example a more recent version of xerces, but any other too), when creating a NormalizedMessage with a DOMSource, users can see this kind of exception:
    java.lang.ClassCastException: org.apache.xerces.dom.ElementNSImpl cannot be cast to com.sun.org.apache.xerces.internal.dom.NodeImpl
    	at org.ow2.petals.jbi.messaging.exchange.impl.NormalizedMessageImpl.makeReadOnly(NormalizedMessageImpl.java:194)
    	at org.ow2.petals.jbi.messaging.exchange.impl.NormalizedMessageImpl.setContent(NormalizedMessageImpl.java:142)
    	at org.ow2.petals.component.framework.message.ExchangeImpl.setOutMessageContent(ExchangeImpl.java:736)
    The problem is coming from the assumption in our code that the implementation when creating new Document is the one from the JDK, which is wrong.
  • Environment:
    -

People

Dates

  • Created:
    Fri, 20 Jan 2017 - 13:13:29 +0100
    Updated:
    Fri, 20 Jan 2017 - 13:59:43 +0100
    Resolved:
    Fri, 20 Jan 2017 - 13:59:43 +0100