1、没有找到对应的Bean是因为,@SpringBootApplication没有扫描到。
Description:
Field userEntityMapper in com.xxx.xxx.service.UserService required a bean of type 'com.xxx.xxx.dao.UserEntityMapper' that could not be found.
Action:
Consider defining a bean of type 'com.xxx.xxx.dao.UserEntityMapper' in your configuration.
解决办法:
1)若是自己写的类,在启动类上加上@MapperScan或者@ComponentScan注解,加上对应的包名。
2)若是引用第三方的包,在启动类上引入对应的包,加上对应的注解即可。
2、nested exception is org.apache.ibatis.binding.BindingException: Parameter 'xxxx’。
解决办法:
服务器端报错,查看了几遍逻辑之后发现竟然是一个超级低级的错误,是dao层忘记加一个参数——@Param,不加这个参数的话无法识别和mapper层的绑定。