Spring boot apache camel和apache camel XPATH

时间:2017-01-20 22:37:23

标签: spring xpath apache-camel

Apache解析带有内容的xml文件时,XPATH失败了。

请找到以下路线

fromF("file://%s?recursive=true", inputDir)
        .routeId("PollFiles")

        .log("*** file found ${header.CamelFileName}")
        .toF("file://%s?recursive=true",
                archiveDir)
         .log("*** file found ${body}")
         //.convertBodyTo(String.class)
        .choice().when()

       .xpath("//Available[Class='package']").   log("*** found ${body}")
        .end();

错误

  

org.apache.camel.TypeConversionException:类型转换时出错从类型:java.lang.String到所需类型:org.w3c.dom.Document带值[Body是java.io.InputStream的实例]由于java .io.FileNotFoundException:/Users/solution//X1.DTD(没有这样的文件或目录)

非常感谢你的帮助

1 个答案:

答案 0 :(得分:1)

它与xpath无关,你的错误说:

java.io.FileNotFoundException: /Users/solution//n (No such file or directory)

表示提供给您方法的文件不存在。