xception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Line 4 in XML document from class path resource [hello.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Document root element "beans", must match DOCTYPE root "null".
org.xml.sax.SAXParseException: Document root element "beans", must match DOCTYPE root "null".
是因为版本冲突的原因:spring 1.0 有DTD的方式定义, spfing 2.0 是用scheme的方式定义文档的
解决方法:
加一行:<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" " http://www.springframework.org/dtd/spring-beans.dtd">