Document root element "beans", must match DOCTYPE root "null".的错误提示
2009-11-15 17:14
405 查看
Document root element "beans", must match DOCTYPE root "null".的错误提示
配置文件spring.xml有两种格式,注意和你引用的版本相匹配就不会出错了:
1.x use XML DTD方式
2.x use schema方式(因为向后兼容,所以也可以使用XML DTD方式)
spring 2.x use schema设置方式
XML Schema的设置方式
<?xml version="1.0" encoding="UTF-8"?>
<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">
<bean>
...
</bean>
</beans>
sprign 1.x 使用DOCTYPE设置方式
XML DTD的设置方式,如下:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="helloBean"
class="onlyfun.caterpillar.HelloBean">
<property name="helloWord">
<value>Hello!Justin!</value>
</property>
</bean>
</beans>
配置文件spring.xml有两种格式,注意和你引用的版本相匹配就不会出错了:
1.x use XML DTD方式
2.x use schema方式(因为向后兼容,所以也可以使用XML DTD方式)
spring 2.x use schema设置方式
XML Schema的设置方式
<?xml version="1.0" encoding="UTF-8"?>
<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">
<bean>
...
</bean>
</beans>
sprign 1.x 使用DOCTYPE设置方式
XML DTD的设置方式,如下:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="helloBean"
class="onlyfun.caterpillar.HelloBean">
<property name="helloWord">
<value>Hello!Justin!</value>
</property>
</bean>
</beans>
相关文章推荐
- spring整合xfire出现Document root element "beans", must match DOCTYPE root "null"错误解决方案
- Document root element "beans", must match DOCTYPE root "null". 原因
- spring整合xfire出现Document root element "beans", must match DOCTYPE root "null"错误解决方案
- Document root element "beans", must match DOCTYPE root "null".
- spring整合xfire出现Document root element "beans", must match DOCTYPE root "null"错误解决方案
- Document root element "beans", must match DOCTYPE root "null"分析及解决方法
- 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".
- Document root element "beans", must match DOCTYPE root "null"分析及解决方法
- Document root element "beans", must match DOCTYPE root "null".
- Document root element "beans", must match DOCTYPE root "null"分析及解决方法
- SAXParseException: cvc-complex-type.3.2.2&&Document root element "beans", must match DOCTYPE root "null"
- Document root element "beans", must match DOCTYPE root "null 心异常
- Document root element "beans", must match DOCTYPE root "null". 解决方法
- Document root element "beans", must match DOCTYPE root "null".
- Document root element "beans", must match DOCTYPE root "null"分析及解决方法
- Document root element "beans", must match DOCTYPE root "null".问题原因
- Document root element "beans", must match DOCTYPE root "null"分析及解决方法
- WebService org.xml.sax.SAXParseException: Document root element "beans",must match DOCTYPE root "nul
- Document root element "form-validation", must match DOCTYPE root "null"