'-6ren"> '-这是我的spring.xml 当我运行我的应用程序测试时,这是我得到的错误: Caused by: org.springframework.beans.factor-6ren">
gpt4 book ai didi

java - Spring 框架 : The document type declaration for root element type "beans" must end with '>'

转载 作者:行者123 更新时间:2023-11-30 06:23:38 25 4
gpt4 key购买 nike

这是我的spring.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans SYSTEM "http://www.springframework.org/dtd/spring-beans-2.0.dtd" PUBLIC "-//SPRING//DTD BEAN 2.0//EN">
<beans>
<bean id="data" class="com.blah.tests.DataProviderClass" />
<bean id="wdcm" class="com.blah.tests.WebDriverCustomMethods"/>
</beans>

当我运行我的应用程序测试时,这是我得到的错误:

    Caused by: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
Line 2 in XML document from class path resource [spring.xml] is invalid; nested exception is org.xml.sax.SAXParseException;
lineNumber: 2; columnNumber: 82; The document type declaration for root element type "beans" must end with '>'.

我使用的是 Spring 3.0.7

最佳答案

试试这个...

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd" >

<bean id="data" class="com.blah.tests.DataProviderClass" />
<bean id="wdcm" class="com.blah.tests.WebDriverCustomMethods"/>

</beans>

关于java - Spring 框架 : The document type declaration for root element type "beans" must end with '>' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18210786/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com