Scala POJO Aggregator Exception

79 views Asked by At

I am getting the following error:

Exception in thread "main" org.apache.camel.RuntimeCamelException: java.lang.IllegalArgumentException: Parameter annotations at index 0 is not supported on method: public java.util.List com.musi.tec.ofp.model.instrument.ext.InstrumentContainer.add(com.musi.tec.ofp.model.instrument.ext.InstrumentContainer,com.musi.tec.ofp.model.instrument.ext.InstrumentContainer) at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1363)

when trying to execute the following Scala Aggregator method:

def add(existing: InstrumentContainer, next: InstrumentContainer):
JList[Instrument] = {....}

the route has been configured via Spring XML as follows:

<bean id="instrumentContainer" class="com.musi.tec.ofp.model.instrument.ext.InstrumentContainer"/>
... 
<route id="aggregateInstruments">        
 <from uri="direct:instruments"/>
  <aggregate strategyRef="instrumentContainer" strategyMethodName="add" completionSize="2">
                <correlationExpression>
                      <constant>true</constant>
                </correlationExpression>
                <to ... 
            </aggregate>

I am using 2.13.1 Any ideas?

0

There are 0 answers