栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

SpringBoot服务器无法正常开启

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

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自带的服务器不知道执行哪个好。
只要将两个类其中的一个注解给注释掉或者改个类名就可以正常运行服务器了。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/735781.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号