【问题标题】:Stripping Illegal Characters from message Stream in Mule从 Mule 中的消息流中去除非法字符
【发布时间】:2016-03-04 17:32:26
【问题描述】:

我遇到了一个问题,即源系统中存在非法字符,当它遇到 DataWeave 转换器时会引发错误。我们已经修复了源系统中的数据,但是我们应该能够在 Mule 中去除这个非法字符。这是它击中 DataWeave 转换器时发生的错误。我需要有关如何以及在何处删除这些“非法”字符的帮助。

ERROR 2015-11-30 17:46:16,837 [[ServiceNow].HTTP_8081_listener.worker.01] org.mule.exception.CatchMessagingExceptionStrategy: 
********************************************************************************
Message               : Illegal character ((CTRL-CHAR, code 25))
 at [row,col {unknown-source}]: [1,916] (com.ctc.wstx.exc.WstxUnexpectedCharException). Message payload is of type: WeaveMessageProcessor$WeaveOutputHandler
Type                  : org.mule.api.MessagingException
Code                  : MULE_ERROR--2
JavaDoc               : http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html
Payload               : com.mulesoft.weave.mule.WeaveMessageProcessor$WeaveOutputHandler@692ffd69
********************************************************************************
Exception stack is:
1. Illegal character ((CTRL-CHAR, code 25))
 at [row,col {unknown-source}]: [1,916] (com.ctc.wstx.exc.WstxUnexpectedCharException)
  com.ctc.wstx.sr.StreamScanner:674 (null)
2. Illegal character ((CTRL-CHAR, code 25))
 at [row,col {unknown-source}]: [1,916] (com.ctc.wstx.exc.WstxUnexpectedCharException). Message payload is of type: WeaveMessageProcessor$WeaveOutputHandler (org.mule.api.MessagingException)
  org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor:32 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
********************************************************************************

【问题讨论】:

    标签: mule dataweave


    【解决方案1】:

    流程需要有效的 SOAP 消息。如果消息无效,那么您所做的是正确的解决方案:修复源系统。仅删除字符并不意味着该消息有意义。

    【讨论】:

    • 很遗憾,消息是有效的,但是其中一个属性中存在非法的 ascii 字符。
    • XML 标准规定了如何对字符进行编码。如果消息不符合标准则无效。
    【解决方案2】:

    创建自定义类来去除消息中的非法字符。

    【讨论】:

      猜你喜欢
      • 2018-10-21
      • 2012-04-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多