target method '%s' found on bean target class '%s', but not found in any interface(s) for bean JDK proxy.

target method '%s' found on bean target class '%s', 
but not found in any interface(s) for bean JDK proxy. 
Either pull the method up to an interface or switch to 
subclass (CGLIB) proxies by setting proxy-target-class/proxyTargetClass
attribute to 'true'

出现场景:

目前我发现@KafkaListener或@Scheduled修饰方法时,如果该类继承了接口类,但接口类里没有写这个方法,就会报错。

解决方法:

在对应的接口类里加上这个方法。

posted @ 2023-05-12 15:51  一语子  阅读(129)  评论(0)    收藏  举报