苏铭客

导航

Referenced file contains errors (http://www.springframework.org/schema/context). For more information, right click on the message in the Problems

spring 配置文件的DTD或schema出问题,一般两种情况:

1.当前网络环境不稳定,按住ctrl+"http://www.springframework.org/schema/context/spring-context.xsd",无法看到配置的链接地址。此时可以这样解决

  http://www.springframework.org/schema/context  classpath:/org.springframework/context/config/spring-context-4.X.xsd,让其加载本地资源。

2.再者网络条件一般但不稳定,你可先在<?xml version="1.0" encoding="UTF-8"?>下加上这段ddt,

<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
此时可能错误消失,若没消失重复剪切几回,直到去掉加的这段ddt,xml不出错。
 
3.尝试清除MyEclipse缓存。
Preferences -> General -> Network Connections -> Cache 删除里面的缓存。
 
还有一种可能是,当前使用的spring版本和配置文件写的不统一,导致xsd等文件不会被正确加载,那么就是改成当前使用的对应版本

在使用spring时,使用多个配置文件,那么头里面的配置版本名一定要统一,理论同上。

posted on 2015-04-24 11:29  苏铭客  阅读(1374)  评论(0编辑  收藏  举报