[ INFO 2008-12-05 16:02:25 org.springframework.core.CollectionFactory - 66 - <clinit> ] : JDK 1.4+ collections available
[ INFO 2008-12-05 16:02:25 org.springframework.beans.factory.xml.XmlBeanDefinitionReader - 163 - loadBeanDefinitions ] : Loading XML bean definitions from resource loaded from byte array
setConfigReader:Line 1 in XML document from resource loaded from byte array is invalid; nested exception is org.xml.sax.SAXParseException: Document root element "beans", must match DOCTYPE root "null".
java.lang.IllegalStateException: MessageSource not initialized - call 'refresh' before accessing messages via the context: org.springframework.context.support.GenericApplicationContext: display name [org.springframework.context.support.GenericApplicationContext;hashCode=27737404]; startup date [Thu Jan 01 08:00:00 CST 1970]; root of context hierarchy
at org.springframework.context.support.AbstractApplicationContext.getMessageSource(AbstractApplicationContext.java:646)
at org.springframework.context.support.AbstractApplicationContext.getMessage(AbstractApplicationContext.java:632)
更改方法
在:<!DOCTYPE beans ....更新至对应的 spring2.5 对应的声明
例如 红色为spring1.2.8的配置文件的文档声明
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
</beans>
升级到spring2.5应对配置文件的文档声明改为
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
</beans>