[英]Spring/Mule schema issue
啟動我的mule應用程序時遇到以下異常:
SEVERE: Line 6 in XML document from mule-spring-config.xml is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 41; cvc-elt.1: Cannot find the declaration of element 'beans'. (org.mule.api.lifecycle.InitialisationException)
org.mule.api.config.ConfigurationException: Line 6 in XML document from mule-spring-config.xml is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 41; cvc-elt.1: Cannot find the declaration of element 'beans'. (org.mule.api.lifecycle.InitialisationException)
at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:52)
at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:78)
at org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:97)
at org.mule.config.builders.MuleXmlBuilderContextListener.createMuleContext(MuleXmlBuilderContextListener.java:169)
at org.mule.config.builders.MuleXmlBuilderContextListener.initialize(MuleXmlBuilderContextListener.java:98)
at org.mule.config.builders.MuleXmlBuilderContextListener.contextInitialized(MuleXmlBuilderContextListener.java:74)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
以下XML是我的mule xml配置文件的開頭。 顯然指定了spring bean的模式。 更糟糕的是,完全相同的標題適用於另一個類似的應用程序。 有沒有人知道這里可能出現什么問題?
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" xmlns:jersey="http://www.mulesoft.org/schema/mule/jersey"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd
http://www.mulesoft.org/schema/mule/jersey http://www.mulesoft.org/schema/mule/jersey/current/mule-jersey.xsd
http://jersey.apache.org/core http://jersey.apache.org/schemas/core.xsd">
<endpoint name="REST" address="http://localhost:8082/system" />
<!-- Otds connector -->
<spring:bean id="tokenProvider"
class="com.is.TokenProvider">
<spring:property name="location"
value="http://sampleLocation.com" />
</spring:bean>
<spring:bean id="credentialStoreClient"
class="com.is.CredentialStoreClient">
<!-- Integration services protocol -->
<spring:constructor-arg index="0"
type="java.lang.String" value="http" />
<!-- Integration services host -->
<spring:constructor-arg index="1"
type="java.lang.String" value="sample.com" />
<!-- Integration services port -->
<spring:constructor-arg index="2"
type="java.lang.String" value="8080" />
<!-- Integration services context -->
<spring:constructor-arg index="3"
type="java.lang.String" value="/server" />
</spring:bean>
<!-- Authentication provider web service class -->
<spring:bean id="authenticationProvider"
class="com.api.system.AuthenticationProvider">
<spring:property name="tokenProvider"
ref="tokenProvider" />
<spring:property name="credentialStoreClient" ref="credentialStoreClient" />
</spring:bean>
<flow name="API">
<inbound-endpoint ref="REST" />
<jersey:resources>
<component class="com.api.system.VersionSender" />
<component>
<spring-object bean="authenticationProvider" />
</component>
</jersey:resources>
</flow>
</mule>
也許這會幫助它在我將VersionSender和Authentication提供程序類的包名從admin更改為system之前全部正常工作!
編輯
Web.xml api-config.xml是上面的mule配置文件。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<context-param>
<param-name>org.mule.config</param-name>
<param-value>api-config.xml</param-value>
</context-param>
<!-- To use a Mule XML configuration file use this context listener -->
<listener>
<listener-class>org.mule.config.builders.MuleXmlBuilderContextListener</listener-class>
</listener>
</web-app>
檢查嵌入Web應用程序的WEB-INF/lib
目錄中的依賴項:Spring JAR的版本必須都是3.1.1.RELEASE
for Mule 3.3.0。 還要確保您實際上嵌入了Spring Beans JAR。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.