Mule
  1. Mule
  2. MULE-5095

DefaultMessageCollection getPayloadAsBytes() and getPayloadAsString(enc) throw UnsupportedOperationException

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 3.0.0
    • Fix Version/s: 3.0.1, 3.1.0
    • Component/s: Core: API
    • Labels:
      None
    • User impact:
      Medium
    • Similar Issues:
      MULE-593HttpsMessageReceiver throws UnsupportedOperationException when disposing of SSLSocket.
      MULE-7015ObjectToHttpClientMethodRequest fails to process DefaultMessageCollection when http.version is set to 1.0
      MULE-5394Calling getPayloadAsBytes() on a MuleMessage with an InputStream payload converts the payload to a byte array
      MULE-6596Self-induced UnsupportedOperationException when disposing DefaultMessageProcessorChain
      MULE-6338Need MEL equivalent of attachments-list:* evaluator
      MULE-7432Behaviour of setPayload in MuleMessageCollection is dependant on the following message processor in the flow
      MULE-6631Throw Exceptions from Flow
      MULE-1603loanbroker example throws NoClassDefFoundError
      MULE-4457getting CopyOnWriteArrayList class cast error when using collection-aggregator-router
      MULE-7234Make AbstractResourceManager.doPrepare throw ResourceManagerException

      Description

      The issue of having these 2 methods throw an UOE is that they are called by Mule itself, like in DefaultMuleEvent.getMessageAsString(enc).

      I don't think it is a correct behavior for Mule to trip on its own UOEs.

        Activity

        Hide
        Andrew Perepelytsya added a comment -

        What are the locations that triggered it? Any sample configs? I don't see how Mule can return a string representation of a payload which can be multiple totally different payloads under the hood.

        Show
        Andrew Perepelytsya added a comment - What are the locations that triggered it? Any sample configs? I don't see how Mule can return a string representation of a payload which can be multiple totally different payloads under the hood.
        Hide
        David Dossot added a comment -

        In DefaultMuleEvent, line 337, there is this call:

        return message.getPayloadAsString(encoding);

        When message is a DefaultMessageCollection, an UOE is thrown.

        Show
        David Dossot added a comment - In DefaultMuleEvent, line 337, there is this call: return message.getPayloadAsString(encoding); When message is a DefaultMessageCollection, an UOE is thrown.
        Hide
        Mike Schilling added a comment -

        We need to distinguish

        1. An attempt to transform a MessageCollection to a String or byte array, which should fail
        2. Getting a representation of the message to be logged, which should succeed. The result should be at least as informative as "MessageCollection".

        Show
        Mike Schilling added a comment - We need to distinguish 1. An attempt to transform a MessageCollection to a String or byte array, which should fail 2. Getting a representation of the message to be logged, which should succeed. The result should be at least as informative as "MessageCollection".
        Show
        Matt Brandabur added a comment - Fixed by http://fisheye.codehaus.org/changelog/mule/?cs=20125

          People

          • Assignee:
            Matt Brandabur
            Reporter:
            David Dossot
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development