Error creating bean with name ‘xxx‘ 错误总结【持续更新】

编程入门 行业动态 更新时间:2024-10-08 13:30:59

Error creating bean with name ‘xxx‘ <a href=https://www.elefans.com/category/jswz/34/1771449.html style=错误总结【持续更新】"/>

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‘ 错误总结【持续更新】

本文发布于:2024-02-14 14:33:17,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1763836.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   creating   Error   xxx   bean

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!