Spring问题 - 必须有偶数的URI
问题描述:
当我启动我的tomcat服务器时出现以下错误。Spring问题 - 必须有偶数的URI
org.xml.sax.SAXParseException; lineNumber: 8; columnNumber: 151; SchemaLocation: schemaLocation value =
'http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://drools.org/schema/drools-spring
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.1.xsd' must have even number of URI's.
,但我的XML有不同
<?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:drools="http://drools.org/schema/drools-spring"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://drools.org/schema/drools-spring
http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-container/drools-spring/src/main/resources/org/drools/container/spring/drools-spring-1.0.0.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.1.xsd">
具有滴料,弹簧1.0.0.xsd参考。我不知道为什么这不会显示在错误信息中。请建议。
在此先感谢。
答
感谢Klaus Groenbaek和laune的线索。当我提取jar时,我看到目标文件夹中的文件没有这个入口,我maven清理并安装了这个项目,并修改了其他一些论坛中建议的模式顺序。问题现在已修复。
您确定您称为“my xml”的文件是由SAX解析器实际处理的文件吗? – laune
听起来像Tomcat应用程序有一个旧版本的xml文件,缺少流口水xsd。如果您正在部署war文件,请解压缩并检查xml文件的内容。如果您是从IDE运行它,请重新构建artefact并检查xml文件是否已复制到运行时类路径中。后续问题,为什么你仍然在xml文件中定义spring上下文? –
不知道如何接受克劳斯答复作为答案。谢谢克劳斯 –