`

Cannot find the declaration of element 'beans'

阅读更多

org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'.

如果在项目中遇到该异常,通常是项目无法下载到spring-beans-2.5.xsd文件而出现的问题,这里的版本号因项目版本而异。

这里需要配置本地的xsd文件,方法如下:

找到你的项目中引用的spring的核心包,spring.jar

用压缩文件打开,找到该路径

org/springframework/beans/factory/xml/

并将这个路径下的xsd文件以下列形式配置到applicationContext.xml文件中,如果有多个配置文件,则全部代替

即以

classpath:/org/springframework/beans/factory/xml/spring-beans-2.5.xsd

代替

 http://www.springframework.org/schema/beans/spring-beans-2.5.xsd 

使得从本地直接读取该配置文件

分享到:
评论

相关推荐

    dubbo找不到dubbo.xsd报错

    - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'dubbo:application'. - schema_reference.4: Failed to read schema document '...

    spring配置文件解析失败报”cvc-elt.1: 找不到元素 ''beans'' 的声明”异常解决

    当遇到“cvc-elt.1: 找不到元素 'beans' 的声明”这种异常时,通常意味着Spring在尝试解析XML配置文件时遇到了问题。这个错误提示表明XML解析器无法找到`<beans>`元素的定义,这是一个基本的Spring配置文件结构元素...

    ESWA的Declaration of Interest statement(利益声明)word版

    "ESWA的Declaration of Interest statement(利益声明)word版"是一个重要的文件,它涉及到作者在发表论文时必须公开的任何可能影响其研究成果公正性的财务或个人关系。这份声明通常会伴随论文一同发布,以确保读者...

    建立SpringMvc工程.doc

    在配置 SpringMvc 工程时,我们可能会遇到一些问题,例如 Cannot find the declaration of element 'beans' 的错误。在这种情况下,我们需要检查 Spring 配置文件的 schema 声明部分,确保正确的命名空间和版本号。 ...

    Declaration of academic integrity form

    requirement analysis •conceptual database design •choice of the DBMS •data model mapping •physical design •implementation

    西门子_CE DECLARATION of CONFORMITY.pdf

    标题中提到的“西门子_CE DECLARATION of CONFORMITY.pdf”指的是西门子公司为某产品家族出具的符合性声明文件(CE Declaration of Conformity),这份文件表明了该产品家族符合欧洲共同体的相关指令,并且已经通过...

    java常见的语法错误

    invalid method declaration; return ``` 方法声明应包含返回类型,如`void`或`int`等。 熟悉并解决这些常见错误可以帮助开发者编写更健壮、更可靠的Java代码。在编写程序时,始终遵循Java的语法规则,进行充分...

    解决:dubbo找不到dubbo.xsd报错

    - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'dubbo:application'. - schema_reference.4: Failed to read schema document '...

    admob 广告 SDK IOS

    AdMob是Google提供的一款强大的移动广告平台,专为开发者设计,用于在iOS和Android应用中集成广告,从而实现盈利。AdMob SDK for iOS是专门为苹果设备优化的版本,允许开发者在其应用程序中无缝地展示各种类型的广告...

    duplicate declaration of name (解决方案).md

    duplicate declaration of name (解决方案).md

    invalid declaration of function (解决方案).md

    invalid declaration of function (解决方案).md

    implicit declaration of function(解决方案).md

    implicit declaration of function(解决方案).md

    修复RzBorder.pas Number of elements differs from declaration

    RzBorder.pas Number of elements differs from declaration TRzLEDCharacters 在装完Raize控件之后编译老是出如下错误: [Pascal Error] RzBorder.pas(1429): E2072 Number of elements (125) differs from ...

    PTA选择题答案

    the value of expression __ is 0.”(根据声明:char c1=92, c2=92; 表达式 __ 的值为 0。)的知识点,C语言中的异或操作符 '^',当两个操作数相等时,结果为0。 对于“According to the declaration: int (*p)[10]...

    Java语言程序设计教程-电子教案

    Java语言程序设计教程-电子教案,好不容易找来的啊,学java的看看吧

    TI-EU Declaration of Conformity (DoC)U-综合文档

    ### TI-EU Declaration of Conformity (DoC)U-综合文档 #### 一、概述 **TI-EU Declaration of Conformity (DoC)U** 文件是德州仪器(Texas Instruments Incorporated, 简称 TI)为其产品所发布的符合性声明。这份...

    elsevier投稿模板

    【Elsevier投稿模板】是为不熟悉CTEX的作者提供的一种方便使用的Word投稿模板,用于在Elsevier期刊上提交论文。这个模板包含了论文的基本结构和格式要求,使得作者能够更轻松地按照Elsevier的规范来编写和组织稿件。...

    raft:Go中的筏式实施

    :person_rowing_boat: 筏 这是Go中Raft分布式共识算法的指导性实现。 它伴随着一系列博客文章: 该存储库中的每个partN目录都是博客文章系列N部分的完整源代码(第0部分除外,该部分是入门性的,没有代码)。...

    浙江大学 C语言 期末测试

    根据给定的浙江大学2004-2005学年冬季学期《C Programming》课程期末考试试卷,我们可以总结出以下关键知识点: ### 单选题解析 #### 1....题目询问哪一个运算符的优先级最低。 - **选项分析**: ...

Global site tag (gtag.js) - Google Analytics