0
votes

According to documentation http://camel.apache.org/spring-boot.html , we can use XML DSL route with spring-boot.

When I use xquery as endpoint with syntax <to uri="xquery:xquery/test.xq />, then it works, but with syntax like below,

<transform>
    <xquery>resource:test.xq</xquery>
</transform>

or inline xquery transformation:

<transform>
    <xquery>concat('hello', 'world')</xquery>
</transform>

Then I get then the error:

org.apache.camel.RuntimeExpressionException: java.lang.IllegalArgumentException: Misdeclaration of xmlns namespace at org.apache.camel.component.xquery.XQueryBuilder.evaluate(XQueryBuilder.java:155) ~[camel-saxon-2.22.1.jar:2.22.1] at org.apache.camel.component.xquery.XQueryBuilder.evaluate(XQueryBuilder.java:120) ~[camel-saxon-2.22.1.jar:2.22.1] at org.apache.camel.processor.TransformProcessor.process(TransformProcessor.java:50) ~[camel-core-2.22.1.jar:2.22.1] at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548) ~[camel-core-2.22.1.jar:2.22.1] at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201) [camel-core-2.22.1.jar:2.22.1] at org.apache.camel.processor.Pipeline.process(Pipeline.java:138) [camel-core-2.22.1.jar:2.22.1] at org.apache.camel.processor.Pipeline.process(Pipeline.java:101) [camel-core-2.22.1.jar:2.22.1] at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201) [camel-core-2.22.1.jar:2.22.1] at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:454) [camel-core-2.22.1.jar:2.22.1] at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:223) [camel-core-2.22.1.jar:2.22.1] at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:187) [camel-core-2.22.1.jar:2.22.1] at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174) [camel-core-2.22.1.jar:2.22.1] at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:101) [camel-core-2.22.1.jar:2.22.1] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_102] at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [na:1.8.0_102] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_102] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [na:1.8.0_102] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_102] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_102] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_102] Caused by: java.lang.IllegalArgumentException: Misdeclaration of xmlns namespace at net.sf.saxon.query.StaticQueryContext.declareNamespace(StaticQueryContext.java:719) ~[Saxon-HE-9.8.0-12.jar:na] at org.apache.camel.component.xquery.XQueryBuilder.initialize(XQueryBuilder.java:721) ~[camel-saxon-2.22.1.jar:2.22.1] at org.apache.camel.component.xquery.XQueryBuilder.evaluateAsString(XQueryBuilder.java:208) ~[camel-saxon-2.22.1.jar:2.22.1] at org.apache.camel.component.xquery.XQueryBuilder.evaluate(XQueryBuilder.java:130) ~[camel-saxon-2.22.1.jar:2.22.1] ... 19 common frames omitted

I tested the syntax with the sample project https://github.com/apache/camel/tree/master/examples/camel-example-spring, and it works, so maybe there is something wrong with camel-spring-boot component?

1

1 Answers

0
votes

A ticket was logged about this issue https://issues.apache.org/jira/browse/CAMEL-12994

And the issue/bug has now been fixed in Apache Camel.

As a workaround you need to either downgrade Camel/Saxon to a previous version that works. Or wait for the next release which has the fix. The JIRA ticket has fixed version numbers declared.