camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dale King <>
Subject Route HANGS processing XML with external DOCTYPE declaration
Date Wed, 18 Sep 2013 13:54:13 GMT
I've used xpath routes previously and had no problem. I tried doing a split
with xpath on an XHTML document however and the route just hangs. It
doesn't throw an exception or simply fail to find a match for the XPath, it
just hangs.

After 4-5 hours of debugging the issue, I have discovered it is because the
XHTML contains an external DTD declaration (a DOCTYPE) as it should. When
converting the XML content to a DOM it tries to load the external DTD which
never completes, causing the route to hang.

The solution I have found is to add the following class and declare it as a
bean in the Spring configuration and Spring will autowire it into the
XmlConverter, but I would be interested in knowing anything better to avoid
the lockup:

public class NoExternalDtdDocumentBuilderFactory extends
    public NoExternalDtdDocumentBuilderFactory() throws
        setFeature("", false);
        setFeature("", false);
        setFeature("", false);
        setFeature("", false);

Dale King

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message