主要错误提示:
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/mvc-servlet.xml]; nested exception is org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name ‘adminUsersController’ for bean class [com.web.controller.admin.UsersController] conflicts with existing, non-compatible bean definition of same name and class [com.web.controller.admin.NewsController]
目录结构:
代码部分:
com.web.controller.admin.UsersController
com.web.controller.admin.NewsController
**错误原因:**同一个文件下,俩个java类都是用了adminUsersController,以致于造成冲突
修改如下(任意一个都可以):