【发布时间】:2015-08-03 18:26:03
【问题描述】:
尝试将 Spring 组件添加到 Mule Flow 时,我收到一条错误消息。这应该是一个常见的用户案例,但我找不到正确的文档或示例。提前致谢。
以下是原始配置并且工作正常:
<flow name="ApplicationEndpoint">
<inbound-endpoint address="server:port/JSONAPI/"/>
<jersey:resources>
<component>
<spring-object bean="myJerseyService"/>
</component>
</jersey:resources>
<catch-exception-strategy doc:name="Catch Exception Strategy">
<flow-ref name="ErrorHandling" doc:name="Flow Reference"/>
</catch-exception-strategy>
</flow>
我只是想添加一个新组件来做一些后期处理。当我尝试这个时,它不起作用:
<flow name="ApplicationEndpoint">
<inbound-endpoint address="server:port/JSONAPI/"/>
<jersey:resources>
<component>
<spring-object bean="myJerseyService"/>
</component>
</jersey:resources>
<component>
<spring-object bean="postProcessor"/>
<component>
<catch-exception-strategy doc:name="Catch Exception Strategy">
<flow-ref name="ErrorHandling" doc:name="Flow Reference"/>
</catch-exception-strategy>
</flow>
“postProcessor”在配置中的其他位置映射为 spring bean。
我得到的错误信息是:
org.xml.sax.SAXParseException:cvc-complex-type.2.4.a:发现以元素“组件”开头的无效内容。应为 '{"http://www.mulesoft.org/schema/mule/core":abstract-lifecycle-adapter-factory, "http://www.mulesoft.org/schema/mule/core":binding}' 之一。
【问题讨论】:
-
我尝试了您的配置并登陆端点“server:port/JSONAPI/”格式错误,无法解析。请您发布完整的 XML 和完整的错误堆栈跟踪。