I have the following bean declaration in camel-context.xml
<bean id="AmbiguousData" class="java.lang.Exception">
<constructor-arg index="0" type="java.lang.String" value="${body}" />
</bean>
The value of body is set dynamically in camel. From the logs I am able to verify that the body is correct("Ambiguous data found for Test2"), but the value passed to the bean is wrong(${body}).
LOG:
...............
BodyType:String , Body:"Ambiguous data found for IMSI_Test2" , CaughtExceptionType:java.lang.Exception, CaughtExceptionMessage:${body}, StackTrace:java.lang.Exception: ${body} at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:121) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:280) ..........
How do I resolve this issue?