camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Eisele <eisele.mar...@gmail.com>
Subject com.sun.org.apache.xerces.internal.dom.TextImpl cannot be cast to java.lang.String
Date Fri, 24 Jul 2015 12:05:13 GMT
Hi,

I was trying to convert a bunch of //text() Nodes selected via XPath
into a List<String> and keep getting a ClassCastException.

My input xml:

  <isbn>9781617290450</isbn>
 <isbn>9780132360280</isbn>

The route

.setHeader("isbns", xpath("/order//isbn/text()"))
.bean(orderService, "handleOrder(${header[isbns]})")

The Bean Method:

public void handleOrder(List<String> orders) {

        orders.stream().forEach((o) -> {
            LOGGER.log(Level.INFO, "Order: {0}", o);
        });


Thanks for a hint.

Cheers,
Markus

Mime
View raw message