i have a trouble solving this exception and i don't know where i'm doing wrong.
here's the Exception.
org.apache.camel.spring.boot.CamelSpringBootInitializationException: java.lang.RuntimeException: org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: >>> Filter[bean[ref:filter method:accept] -> []] <<< in route: Route(route1)[[From[file:D:/copyy/?noop=true]] -> [Filter[be... because of Definition has no children on Filter[bean[ref:filter method:accept] -> []]
Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: >>> Aggregate[true -> []] <<< in route: Route(route1)[[From[file:D:/xml/?noop=true]] -> [Aggregate[t... because of Definition has no children on Aggregate[true -> []]
Caused by: java.lang.IllegalArgumentException: Definition has no children on Aggregate[true -> []]
and here's my router :
<bean id="AggregatorDemo" class="com.javainuse.AggregatorDemo"/>
<route>
<from uri="file:D:/xml/?noop=true" />
<aggregate strategyRef="AggregatorDemo">
<correlationExpression>
<constant>true</constant>
</correlationExpression>
</aggregate>
<log message=".....${body}...."></log>
<to uri="file:D:/Xmlcopy" />
</route>
and here's the aggregator class i'm using.
public class AggregatorDemo implements AggregationStrategy{
public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
if (oldExchange == null) {
return newExchange;
}
String orders = oldExchange.getIn().getBody(String.class);
String newLine = newExchange.getIn().getBody(String.class);
orders = orders+ newLine;
oldExchange.getIn().setBody(orders);
return oldExchange;
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…