SpringBoot服务器无法正常开启

SpringBoot自带的服务器无法正常启动,但是控制台也没有打印任何异常信息
在这里插入图片描述
编译通过后,服务器直接停止运行,错误原因是因为: Annotation-specified bean name ‘userController’ for bean class [com.jt.demo03.controller.UserController] conflicts with existing, non-compatible bean definition of same name and class [com.jt.demo02.controller.UserController]

翻译过来的意思就是,注解为bean类[com.jt.demo03.controller.userController]指定的bean名称“userController”与现有的、不兼容的、同名的bean定义和类[com.jt.demo02.controller.userController]冲突
在这里插入图片描述
这两个类同名并且都有@Component注解,导致了SpringBoot自带的服务器不知道执行哪个好。
只要将两个类其中的一个注解给注释掉或者改个类名就可以正常运行服务器了。
在这里插入图片描述


版权声明:本文为qq_46484190原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。