spring的bean中未写class报错:org.springframework.beans.factory.parsing.BeanDefinitionParsingException:

(已解决)

问题:
一月 07, 2020 6:49:33 下午 org.apache.catalina.core.StandardContext loadOnStartup
严重: Servlet [SpringMVC] in web application [/information] threw load() 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 [spring-mvc.xml]

解决办法:查看spring中bean文件是否未写class
解决前:

<bean>
	   <!--  前缀 -->
	   <property name="prefix" value="/jsp/"></property>
	    <!-- 后缀 -->
	    <property name="suffix" value=".jsp"></property>
	</bean>

解决后:

<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
	   <!--  前缀 -->
	   <property name="prefix" value="/jsp/"></property>
	    <!-- 后缀 -->
	    <property name="suffix" value=".jsp"></property>
	</bean>

你可能感兴趣的:(spring)