`
ldzyz007
  • 浏览: 701873 次
  • 性别: Icon_minigender_1
  • 来自: 西安
社区版块
存档分类
最新评论

Document root element "beans", must match DOCTYPE

阅读更多
struts2+spring2+hhibernate3开发时在项目中引入了一个XFire开发的web service客户端后
报错:org.xml.sax.SAXParseException:Document root element "beans", must match DOCTYPE
原因:spring配置文件中没有声明:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

如果bean要声明scope或者singleton
在spring2.0之前bean只有2种作用域即:singleton(单例)、non-singleton(也称prototype), Spring2.0以后,增加了session、request、global session三种专用于Web应用程序上下文的Bean。

<!-- using spring-beans-2.0.dtd -->
<bean id="accountService" scope="prototype"/>
<!-- the following is equivalent and preserved for backward compatibility in spring-beans.dtd -->
<bean id="accountService" singleton="false"/>

如果你用"singleton"属性那么就必须在那个文件里  引用'spring-beans.dtd' DTD。 如果你用"scope"属性那么必须 在那个文件里引用'spring-beans-2.0.dtd' DTD 或'spring-beans-2.0.xsd' XSD
分享到:
评论
1 楼 pdw2009 2012-08-15  
呵呵,说得极对!

相关推荐

    dubbo找不到dubbo.xsd报错

    构建dubbo项目的时候会遇到: Multiple annotations found at this line: - cvc-complex-type.2.4.c: The matching wildcard is strict, but no ... 3) the root element of the document is not &lt;xsd:schema&gt;.

    Beans使用 Beans使用

    Beans使用 Beans使用 Beans使用

    spring-beans.jar

    org.springframework.beans-2.5.5.A.jar, org.springframework.beans-2.5.6.A.jar, org.springframework.beans-2.5.6.SEC01.jar, org.springframework.beans-3.0.0.M1.jar, org.springframework.beans-3.0.0.M2.jar,...

    spring-beans-5.2.0.RELEASE-API文档-中文版.zip

    赠送jar包:spring-beans-5.2.0.RELEASE.jar; 赠送原API文档:spring-beans-5.2.0.RELEASE-javadoc.jar; 赠送源代码:spring-beans-5.2.0.RELEASE-sources.jar; 赠送Maven依赖信息文件:spring-beans-5.2.0....

    spring-beans-5.0.10.RELEASE-API文档-中文版.zip

    赠送jar包:spring-beans-5.0.10.RELEASE.jar; 赠送原API文档:spring-beans-5.0.10.RELEASE-javadoc.jar; 赠送源代码:spring-beans-5.0.10.RELEASE-sources.jar; 赠送Maven依赖信息文件:spring-beans-5.0.10....

    开发工具 spring-beans-4.3.6.RELEASE

    开发工具 spring-beans-4.3.6.RELEASE开发工具 spring-beans-4.3.6.RELEASE开发工具 spring-beans-4.3.6.RELEASE开发工具 spring-beans-4.3.6.RELEASE开发工具 spring-beans-4.3.6.RELEASE开发工具 spring-beans-...

    spring-beans-5.2.0.RELEASE-API文档-中英对照版.zip

    赠送jar包:spring-beans-5.2.0.RELEASE.jar; 赠送原API文档:spring-beans-5.2.0.RELEASE-javadoc.jar; 赠送源代码:spring-beans-5.2.0.RELEASE-sources.jar; 赠送Maven依赖信息文件:spring-beans-5.2.0....

    webbeans 入门手册

    webbeans入门,javaEE6中cdi规范的详细介绍。

    spring-beans-5.3.7-API文档-中英对照版.zip

    赠送jar包:spring-beans-5.3.7.jar; 赠送原API文档:spring-beans-5.3.7-javadoc.jar; 赠送源代码:spring-beans-5.3.7-sources.jar; 赠送Maven依赖信息文件:spring-beans-5.3.7.pom; 包含翻译后的API文档:...

    Android代码-random-beans

    Random Beans Because life is too short to generate random Java™ beans by hand.. Latest news 27/01/2019: Version 3.8.0 is finally out! Checkout what's new in the change log. 19/06/2017: ...

    spring-beans-5.1.0.RELEASE

    spring-beans-5.1.0.RELEASE,最新spring-bean jar包。

    spring-beans-3.0.xsd

    spring-beans-3.0.xsd

    net beans 使用说明

    net beans 使用说明

    spring-beans.zip

    包含spring-beans-4.0.0.RELEASE.jar,spring-beans-4.1.0.RELEASE.jar,spring-beans-4.2.0.RELEASE.jar,

    spring beans jar

    spring beans jar包,需要另外3个包。加上log4j和logging

    spring-beans-5.1.3.RELEASE-API文档-中文版.zip

    赠送jar包:spring-beans-5.1.3.RELEASE.jar; 赠送原API文档:spring-beans-5.1.3.RELEASE-javadoc.jar; 赠送源代码:spring-beans-5.1.3.RELEASE-sources.jar; 赠送Maven依赖信息文件:spring-beans-5.1.3....

    spring-beans源码

    spring-beans源码,可以直接导入Eclipse工程里面

    spring-beans-4.3.12.RELEASE-API文档-中文版.zip

    赠送jar包:spring-beans-4.3.12.RELEASE.jar; 赠送原API文档:spring-beans-4.3.12.RELEASE-javadoc.jar; 赠送源代码:spring-beans-4.3.12.RELEASE-sources.jar; 赠送Maven依赖信息文件:spring-beans-4.3.12....

    spring-beans-4.3.20.RELEASE-API文档-中文版.zip

    赠送jar包:spring-beans-4.3.20.RELEASE.jar; 赠送原API文档:spring-beans-4.3.20.RELEASE-javadoc.jar; 赠送源代码:spring-beans-4.3.20.RELEASE-sources.jar; 包含翻译后的API文档:spring-beans-4.3.20....

Global site tag (gtag.js) - Google Analytics