当运行mule时,当使用@InboundAttachments参数的devkit 3.0.0方法时,引发Null异常



我正在尝试使用@attachment http属性

我有一个名为validate的devkit方法,它在一个称为like so 的流中

<http:connector name="httpConnector" doc:name="HTTPHTTPS">
    <service-overrides
        messageFactory="org.mule.transport.http.HttpMultipartMuleMessageFactory" />
</http:connector>
<flow name="AttachmentTestFlow1" doc:name="AttachmentTestFlow1">        
    <http:inbound-endpoint connector-ref="httpConnector" doc:name="HTTP" exchange-pattern="request-response" host="localhost" port="8100"/>
    <Foo:validate config-ref="TestMessageSizeHappy"  />
</flow>

在Devkit中:

@Processor
public Object validate(@Payload InputStream in
    ,@InboundAttachments("*") Map<String, DataHandler> inboundAttachments
    ,@OutboundAttachments Map<String, DataHandler> outboundAttachments
    ) {

然而,当运行我的mule应用程序时,会抛出:

错误2013-07-30 09:06:39225[min]org.mule.module.launcher.application.DefaultMuleApplication:nullorg.xml.ax.SAXParseException:cvc复杂类型2.4.b:的内容元素"xmlthreatprotection:validate"不完整。其中之一"{"http://www.mulesoft.org/schema/mule/core":注释,"http://www.mulesoft.org/schema/mule/xmlthreatprotection":入站附件}"应为。在org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(未知来源)

在我看来,mule希望附件能作为一个属性放进去!当我删除@attachment内容时,我在运行时不会出现任何错误。

您确定DevKit支持此功能吗?我在源代码中找不到一个单独的集成测试来练习@InboundAttachments@OutboundAttachments注释,而@InboundHeaders@OutboundHeaders都包含了测试。

或者,您可以接收MuleEvent并通过它访问附件:

@Processor
@Inject
public Object validate(@Payload InputStream in, MuleEvent muleEvent) {

最新更新