Spring启动错误: cvc-elt.1: Cannot find the declaration of element 'beans'

Spring启动异常: cvc-elt.1: Cannot find the declaration of element 'beans'

在配置文件前添加:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>

即可

 

错误原因:Jar包版本冲突。工程中引用的Spring的版本为2.0,而在Spring配置文件中引用了spring-beans-2.5的模板。