Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用spring.schemas和spring.handlers来短路依赖关系';模式查找_Spring_Mule - Fatal编程技术网

如何使用spring.schemas和spring.handlers来短路依赖关系';模式查找

如何使用spring.schemas和spring.handlers来短路依赖关系';模式查找,spring,mule,Spring,Mule,我正试图升级到在Mule 3.4.0 CE下运行,但在命令行上运行mvn clean install时得到了以下信息 [10-16 13:51:05] WARN XmlBeanDefinitionReader [main]: Ignored XML validation warning org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://www.springframe

我正试图升级到在Mule 3.4.0 CE下运行,但在命令行上运行
mvn clean install
时得到了以下信息

[10-16 13:51:05] WARN  XmlBeanDefinitionReader [main]: Ignored XML validation warning org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/beans/spring-beans-current.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
....
testExternalGenerator(org.mule.module.cache.ExpressionTest): Line 6 in XML document from URL [jar:file:/Users/me/.m2/repository/org/mule/modules/mule-module-spring-config/3.4.0/mule-module-spring-config-3.4.0.jar!/mule-spring-config.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'. (org.mule.api.lifecycle.InitialisationException)
有没有一种方法可以让我使用将当前点设置为3.1


或者我需要采取不同的方法吗?

当前SpringBeans模式的URI是:

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


如果我理解您的问题,那么您将创建一个名为spring.schemas的文件,将其存储在WAR或EAR文件的META-INF目录中,并使其包含以下条目:

http:\//www.springframework.org/schema/beans/spring-beans-current.xsd=http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http:\//www.springframework.org/schema/beans/spring-beans-current.xsd=org/springframework/beans/factory/xml/spring-beans-3.1.xsd
如果不想从internet获取XSD,请添加以下条目:

http:\//www.springframework.org/schema/beans/spring-beans-current.xsd=http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http:\//www.springframework.org/schema/beans/spring-beans-current.xsd=org/springframework/beans/factory/xml/spring-beans-3.1.xsd
第二个假设相应的spring-beans.jar在您的类路径中。据我所知,最后一个选项是将SpringConfig.xml文件中的条目更改为:

xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd"


但是我如何让我的应用程序指向
http://www.springframework.org/schema/beans/spring-beans.xsd
当Mule库中的xsd显式调用
http://www.springframework.org/schema/beans/spring-beans-current.xsd
?我试图做的是拦截调用,以在frameworkjar中定义的位置获取xsd。似乎报告了相同的问题,但没有解决方案。我想我不理解您当时面临的核心问题。我将尝试澄清:我正在使用Mule CE 3.4.0,其中包括jar:file:/Users/me/.m2/repository/org/Mule/modules/Mule module-spring-config/3.4.0/Mule-module-spring-config-3.4.0.jar。这个jar(这是一个Mule jar,不是我自己制作的)有一个xsd,它定义了
xsi:schemaLocation=”http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd“
。我认为这就是造成我的问题的原因,但要解决这个问题,我知道的唯一方法是修改我下载的Mule jar中的xsd,将该版本的jar放回(cont)(来自上一个)我的本地Maven repo。我希望有一种不那么刻薄的方式让我告诉Maven指向某个地方,而不是Mule xsd告诉它的地方。希望这是令人困惑的,因为我面临的问题有一个简单的解决方案。基本上,Mule jar的xsd似乎是错误的,但我似乎不是第一个发现这一点的人,所以我的本地设置可能有问题。似乎是说xsd需要更改,但我没有访问该repo的权限。你检查过我在3.4.0上编译的fork吗?我以前没有——只是检查了一下,我的问题不再发生了。这解决了我眼前的问题。可能在这里对我也有用,但我怀疑mule配置文件还存在其他问题。
xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd"
xsi:schemaLocation=" http://www.springframework.org/schema/beans classpath:org/springframework/beans/factory/xml/spring-beans-3.1.xsd"