错误总结【持续更新】"/>
Error creating bean with name ‘xxx‘ 错误总结【持续更新】
1.resultMap名字错误
检查resultMap拼写是否正确,方法的resultMap和定义的resultMap是否对应
2.resultMap中定义了 typeHandler
resultMap中定义了typeHandler类型转换,但没有写typeHandler的具体实现。或者写了typeHandler的实现,resultMap中没有定义
3.service层代码写成递归了
检查service是否存在递归调用,例如:
@Override
public List<User> getUserList(){return getUserList();
}
4.注解是否没写
Controller、Service、Dao三层包中对应的注解是不是没加?如@Controller、@Service、@Mapper、@Repository等
5.没有开启注解扫描bean
Spring项目配置文件,查看有没有开启注解扫描bean,例如:
@SpringBootConfiguration
@EnableAutoConfiguration
@ComponentScan("com.example")
6.扫描包名是否写错
Spring项目配置文件,springmvc-config和applicationContext,或者@Configuration类中
扫描Service、Contrller包的代码,查看包名是否写错
7.XXXMapper.xml配置中parameterType
XXXMapper.xml配置中parameterType如果是类的类型,看类名是不是写错了
8.检查xml中映射是否一致
例如:
更多推荐
Error creating bean with name ‘xxx‘ 错误总结【持续更新】
发布评论