为了账号安全,请及时绑定邮箱和手机立即绑定

一直报错说 找不到bean

Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'myBatisCRUDController': Unsatisfied dependency expressed through field 'clothService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'clothServiceImpl': Unsatisfied dependency expressed through field 'clothMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'clothMapper' defined in file [F:\Project\target\classes\com\abc\mapper\ClothMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [tk/mybatis/mapper/autoconfigure/MapperAutoConfiguration.class]: Unsatisfied dependency expressed through method 'sqlSessionFactory' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [com/alibaba/druid/spring/boot/autoconfigure/DruidDataSourceAutoConfigure.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'dataSource' threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/boot/bind/RelaxedDataBinder

正在回答

5 回答

解决了吗?


0 回复 有任何疑惑可以回复我~

我也是这个错

0 回复 有任何疑惑可以回复我~

NoClassDefFoundError: org/springframework/boot/bind/RelaxedDataBinder

boot里面找不到包,org.springframework.boot.bind 包已经删掉了,导致RelaxedPropertyResolver这个方法已经不可用了.

<dependency>
    <groupId>com.alibaba</groupId>
   <artifactId>druid-spring-boot-starter</artifactId>
   <version>1.1.0</version>
</dependency>

这个依赖删掉即可~~

1 回复 有任何疑惑可以回复我~
#1

yindz

删掉都不行
2019-05-27 回复 有任何疑惑可以回复我~

我也启动报错,找不到这个注入的service的Bean,注解都没少,对着老师的代码写的,到底在哪配置的bean啊?

0 回复 有任何疑惑可以回复我~

看看少不少注解 @RestController 以及 'myBatisCRUDController'里面的接口上面有没有@Autowried  

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

一直报错说 找不到bean

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信