配置文件出现错误
我在建web project,add Spring capabilities..后。在web-inf/spring-config自动生成的配置文件出现错误。
错误提示:
spring referenced file contains errors (http://www.springframework.org/schema/beans/spring-beans-2.0.xsd)<?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">
</beans>我是在myEclipse5.5做的,以前都没有碰过这种情况,今天郁闷了。虽然有错误提示,但程序还可以正常运行哦。有了错误提示,很多关键字都要亲自敲过。请问下有什么方法可以解决的吗?

解决方案 »

  1.   

    也许你的网络问题。你是不是在内网啊!
    eclipse 不能连接外网的原因!
      

  2.   

    lz改为这个试一试,我这边没有问题。
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
    "http://www.springframework.org/dtd/spring-beans.dtd">
    <beans>配置你的bean</beans>
      

  3.   

    建议自己修改dtd,或者schema,指向本地
      

  4.   

    eclipse 相关文件损坏??
    重新配置一下
    或者这个链接(http://www.springframework.org/schema/beans/spring-beans-2.0.xsd)
    重新拷贝一个试试?
      

  5.   


    谢谢了,改成你那样的,运行OK了!但是我想知道,是什么原因造成这样的,因为我前几天一直在做,后来做了个Spring+Hibernate+Struts 项目时,就出现那个情况了。连以前做的没有问题的例子打开来都出错了。
      

  6.   


    内网就是这样,会出这种问题,以前经常遇到,其实把那些xml文件下载下来,然后本地使用也是一个很好的注意。
      

  7.   


    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="
           http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
           http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
           http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd">
    如果使用的是SPRING2,尝试上面的配置
      

  8.   

    我用spring3.0f提示错误如下,但可以正常运行。Referenced file contains errors (http://www.springframework.org/schema/beans/spring-beans-3.0.xsd)最后解决,是因为有全角空格造成的
      

  9.   

    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
    但是spring是3.0或者更高的版本