I am trying to run a function in background asynchronously. For this I am trying Spring's @Async annotation but my application is unable to start after putting this annotation on the function.
I tried
@EnableAsync(proxyTargetClass = true)
but still no luck.
Below is the message I am getting on application start.
APPLICATION FAILED TO START
Description:
The bean 'MyBatchSyncProcessor' could not be injected as a 'com.a.b.c.service.MyBatchSyncProcessor' because it is a JDK dynamic proxy that implements: com.a.b.c.service.BaseSyncProcessor
Action:
Consider injecting the bean as one of its interfaces or forcing the use of CGLib-based proxies by setting proxyTargetClass=true on @EnableAsync and/or @EnableCaching.
Please help me out in getting this application up and running.
AutowireorInjectcom.a.b.c.service.MyBatchSyncProcessorsomewhere in your code? - Ervin Szilagyicom.a.b.c.service.BaseSyncProcessoris an interface. - Ervin Szilagyi@Asyncmethod maybe :) Don't think it makes sense to add String.java source code or smth. like that. - ikos23