Uploaded image for project: 'Mule'
  1. Mule
  2. MULE-15991

No transformers for Iterator to byte[] or String cause error

    XMLWordPrintable

Details

    • S2
    • No
    • Pre-production defect
    • Functional
    • 4
    • Prod Eng - Enlil 05/08, Prod Eng - Ganesha 06/05, Prod Eng - Freya 05/22
    • S2 (Regular)
    • nothing

    Description

      When the payload of a message is an iterator (for instance, the output of an sftp-read or a db query) and trying to send that response through http, a transformer from iterator to byte[] is searched, but none is found and an error occurs:

      ********************************************************************************
      Message               : The transformer "ObjectToByteArray" does not support source type "org.mule.runtime.core.internal.streaming.object.ManagedCursorIteratorProvider$ManagedCursorIterator".
      Element               : https-for-each-flow/source @ http-extension-requester-1.0.0-mule-application:mule-config.xml:177
      Element XML           : <http:listener path="/https-for-each-initial" config-ref="http_listener_config"></http:listener>
      Error type            : MULE:SOURCE_RESPONSE_SEND
      Payload Type          : org.mule.runtime.core.internal.streaming.object.ManagedCursorIteratorProvider
      Transformer           : ObjectToByteArray{this=87bf578, name='ObjectToByteArray', ignoreBadInput=false, returnClass=SimpleDataType{type=[B, mimeType='*/*'}, sourceTypes=[SimpleDataType{type=java.io.Serializable, mimeType='*/*'}, SimpleDataType{type=java.io.InputStream, mimeType='*/*'}, SimpleDataType{type=java.lang.String, mimeType='*/*'}, SimpleDataType{type=org.mule.runtime.api.streaming.bytes.CursorStreamProvider, mimeType='*/*'}, SimpleDataType{type=org.mule.runtime.core.api.message.OutputHandler, mimeType='*/*'}, SimpleDataType{type=java.lang.Byte, mimeType='*/*'}, SimpleDataType{type=byte, mimeType='*/*'}]}
      --------------------------------------------------------------------------------
      Root Exception stack trace:
      org.mule.runtime.core.api.transformer.TransformerException: The transformer "ObjectToByteArray" does not support source type "org.mule.runtime.core.internal.streaming.object.ManagedCursorIteratorProvider$ManagedCursorIterator".
          at org.mule.runtime.core.api.transformer.AbstractTransformer.transform(AbstractTransformer.java:246)
          at org.mule.runtime.core.api.transformer.AbstractTransformer.transform(AbstractTransformer.java:211)
          at org.mule.runtime.core.privileged.transformer.TransformerChain.transformMessage(TransformerChain.java:64)
          at org.mule.runtime.core.api.transformer.AbstractMessageTransformer.transform(AbstractMessageTransformer.java:139)
          at org.mule.runtime.core.api.transformer.AbstractMessageTransformer.transform(AbstractMessageTransformer.java:78)
          at org.mule.runtime.core.api.DefaultTransformationService.getPayload(DefaultTransformationService.java:136)
          at org.mule.runtime.core.api.DefaultTransformationService.internalTransform(DefaultTransformationService.java:69)
          at org.mule.runtime.core.api.DefaultTransformationService.lambda$transform$1(DefaultTransformationService.java:168)
          at org.mule.runtime.core.api.util.func.CheckedSupplier.get(CheckedSupplier.java:25)
          at org.mule.runtime.core.api.DefaultTransformationService.transformThrowingRuntimeException(DefaultTransformationService.java:173)
          at org.mule.runtime.core.api.DefaultTransformationService.transform(DefaultTransformationService.java:168)
          at org.mule.extension.http.internal.listener.HttpResponseFactory.getMessageAsBytes(HttpResponseFactory.java:183)
      

      A Default transformer for Iterators should be provided by Mule.

      Attachments

        Activity

          People

            eugenia.mariotti@mulesoft.com Eugenia Mariotti [X] (Inactive)
            rodrigo.merino@mulesoft.com Rodrigo Merino
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              SLAEndDate: