SpringMVC异常:HTTP Status 500 - Servlet.init() for servlet springmvc threw exception

SpringMVC异常:HTTP Status 500 - Servlet.init() for servlet springmvc threw exception

异常输出

HTTP Status 500 - Servlet.init() for servlet springmvc threw exception

异常原因

org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unnamed bean definition specifies neither 'class' nor 'parent' nor 'factory-bean' - can't generate bean name
Offending resource: class path resource [springmvc.xml]

异常分析

这里写图片描述
由异常提示可以知道,在xml文件中有未命名的bean,所以只要将这个bean删除或者注释就好了。
这里写图片描述

这是我的配置文件写多的bean,也是导致异常的原因,所以bean也是不能乱用的。

猜你喜欢

转载自blog.csdn.net/zpr5554321/article/details/79582686