cannot resolve method,validates method refences in code configuration

cannot resolve method,validates method refences in code configuration

cannot resolve method,validates method refences in code configuration

cannot resolve method,validates method refences in code configuration

cannot resolve method,validates method refences in code configuration

从以上图片代码中可以看出,@Bean的initMethod和destoryMethod方法不是作用在定义init和destory的方法的类BeanWayService上,而是定义在了UseBeanWayService上导致的报错。

解决办法:把方法的返回值类型修改为BeanWayService即可。如下图:
cannot resolve method,validates method refences in code configuration