`

解决Failed to read schema document 'http://www.springframework.org

 
阅读更多

哎,电脑卡了强制重启后Eclipse工作空间就出问题了,不管怎么选原来的工作空间都不能加载,反而是Eclipse自己创建一个“new_workspace”空间,将原来的“workspace”空间下“.metadata”里的所有文件删除还是不能加载。最后还是放弃了。只能前这样了,后续再来找问题。

 

就于“new_workspace”空间下把原来“workspace”的项目引入Eclipse当中结果出现如下图错误信息:

百度上一查说是Jar问题,可是原来项目都没有问题,更何况是Maven的项目。后来找到一网友的贴子,网址如下:

http://blog.sina.com.cn/s/blog_9772ef170101h6co.html

根据他所说的操作后保存,不后错了。然后我再把代码还原也不报错了。为什么,不知道。求解答,谢谢。

 

附上xml中的xmlns,xmlns:xsi,xsi:schemaLocation有什么作用解释:

    原问题:

 

如 maven 的 pom.xml 开头是下面这样的
谁能解释下,这东西有社么用,不写这东西又会怎么样的,官方拷贝来的说明文档就算了,我想要简明扼要的说明。
不胜感激
---------
<project xmlns="http://maven.apache.org/POM/4.0.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 

   认为较好的解释:

 

 

首先这个文件是一个xml文件,那么他里面的所有内容都符合xml语法规范,
开头的<project></project>这最外层同样也是一个xml文件的标签,
后面那一长串也就是所谓的属性,其中xmlns表示命名空间,
xmlns="http://maven.apache.org/POM/4.0.0" 这表示默认命名空间,
而下面xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
这个命名空间里面的元素或者属性就必须要以xsi:这种方式来写,
比如schemaLocation就是他的一个属性,所以写成xsi:schemaLocation,
而默认命名空间不带类似xsi这种,其实xml标签名称有个专业叫法叫做QName,
而如果没有前面的xsi:这种一般叫做NCName。所以你看mvn里面的<dependency>这种
就是默认命名空间下面的元素,最后那一行就表示把定义这个命名空间的schema文件给引用进来,
好让eclipse这类型工具能够解析和验证你的xml文件是否符合语法规范。
等同于<import namespace="xxx" schemaLocation="xxx.xsd"/>。

    问题地址:http://bbs.csdn.net/topics/390751819

 

  • 大小: 23.3 KB
分享到:
评论

相关推荐

    解决dubbo启动的时候报错,无法读取方案文档 'http://code.alibabatech.com/schema/dubbo/dubbo.xsd'

    解决启动dubbo项目的时候出现,无法读取方案文档 'http://code.alibabatech.com/schema/dubbo/dubbo.xsd',其实在你本地把dubbo.jar文件解压,然后在META-INF下边就有个dubbo.xsd,就是他

    dubbo.xsd文件

    &lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt; &lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" ... &lt;xsd:import namespace="http://www.springframework.org/schema/tool"/&gt;

    dubbo找不到dubbo.xsd报错

    - schema_reference.4: Failed to read schema document 'http://code.alibabatech.com/schema/dubbo/dubbo.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root ...

    dubbo.xsd 约束文件 解决标签识别报红

    - schema_reference.4: Failed to read schema document 'http://code.alibabatech.com/schema/dubbo/dubbo.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root ...

    Spring入门笔记.md

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

    项目源码java京东商城购物网站

    &lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop=...

    Spring4.0+Hibernate4.0+Struts2.3整合案例

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

    11spring4_aop3.rar

    http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd"&gt; ...

    spring声明式事务配置

    &lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;beansxmlns=......

    springmvc-config.xml

    这是一个springmvc-config.xml文件,&lt;?xml version="1.0" encoding="UTF-8"?&gt; xmlns:xsi=... http://www.springframework.org/schema/context/spring-context-4.2.xsd"&gt;

    spring-ibatis

    &lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context=...

    Spring实战2-Bean注入详解的源代码

    xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:context=...

    struts hibernate spring 集成时使用依赖注解的方式的秘籍

    xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans ...

    spring2.0声明式事务

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

    springmvc笔记

    &lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:aop=...

    springmvc-ibatis

    &lt;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" xmlns:aop=...

    springjdbc

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

    SpringMVC配置文件最全约束

    xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:mvc=...

    dubbo.xsd阿里巴巴开源xsd文件

    xmlns:beans="http://www.springframework.org/schema/beans" xmlns:tool="http://www.springframework.org/schema/tool" targetNamespace="http://code.alibabatech.com/schema/dubbo"&gt; &lt;xsd:import ...

Global site tag (gtag.js) - Google Analytics