[
https://issues.apache.org/jira/browse/CAMEL-8940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14616786#comment-14616786
]
Sarat Khilar commented on CAMEL-8940:
-------------------------------------
I am expecting when employee object is sent to seda:test, it should route to
handler method. I am getting below exception.
2015-07-07 20:02:28.372 ERROR 7175 --- [#4 - customPool]
o.a.camel.processor.DefaultErrorHandler : Failed delivery for (MessageId:
ID-ubuntu-36404-1436279542902-0-14 on ExchangeId:
ID-ubuntu-36404-1436279542902-0-24). Exhausted after delivery attempt: 1
caught: java.lang.IllegalStateException: No method invocation could be created,
no matching method could be found on:
com.hospira.mednet.handler.EmployeePersistHandler@137dce2
Message History
---------------------------------------------------------------------------------------------------------------------------------------
RouteId ProcessorId Processor
Elapsed (ms)
[route1 ] [route1 ] [vm://seda:test
] [ 149]
[route1 ] [threads1 ] [threads
] [ 96]
[route1 ] [bean1 ]
[bean[com.hospira.mednet.handler.EmployeePersistHandler@137dce2]
] [ 2]
Exchange
---------------------------------------------------------------------------------------------------------------------------------------
Exchange[
Id ID-ubuntu-36404-1436279542902-0-24
ExchangePattern InOnly
Headers {breadcrumbId=ID-ubuntu-36404-1436279542902-0-14,
CamelRedelivered=false, CamelRedeliveryCounter=0}
BodyType com.hospira.mednet.model.Employee
Body com.hospira.mednet.model.Employee@4cf64eb
]
Stacktrace
---------------------------------------------------------------------------------------------------------------------------------------
java.lang.IllegalStateException: No method invocation could be created, no
matching method could be found on:
com.hospira.mednet.handler.EmployeePersistHandler@137dce2
at
org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:165)
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:448)
at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)
at org.apache.camel.processor.Pipeline.access$100(Pipeline.java:43)
at org.apache.camel.processor.Pipeline$1.done(Pipeline.java:136)
at
org.apache.camel.processor.ThreadsProcessor$ProcessCall.run(ThreadsProcessor.java:83)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Note:
If, I am not used generics, it is working perfectly.
> Message routing to a method in the bean is not working if generics is used.
> ---------------------------------------------------------------------------
>
> Key: CAMEL-8940
> URL: https://issues.apache.org/jira/browse/CAMEL-8940
> Project: Camel
> Issue Type: Bug
> Components: bean-integration
> Affects Versions: 2.15.2
> Reporter: Sarat Khilar
>
> Message routing is not working if generic method inteface is used.
> I have added the code snippet here.
> Bean component:
> public interface IHandler<T>
> {
> @Handler
> public void handle(T data);
> }
> public class EmployeePersistHandler implements IHandler<Employee>
> {
> public EmployeePersistHandler()
> {
> super();
> }
> @Override
> public void handle(Employee data)
> {
>
> }
> }
> Routing config:
> public RouteBuilder route()
> {
> return new RouteBuilder() {
>
> @Override
> public void configure() throws Exception
> {
> System.out.println("Route builder is called");
> ThreadPoolBuilder poolBuilder = new
> ThreadPoolBuilder(createCamelContext());
> ExecutorService customPool =
> poolBuilder.poolSize(5).maxPoolSize(100).maxQueueSize(-1).build("customPool");
>
> from("seda:test").shutdownRunningTask(ShutdownRunningTask.CompleteAllTasks).threads().executorService(customPool).bean(employeePersistHandler);
>
> }
> };
>
> }
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)