org.mule.api.transformer.TransformerException: Could not find a transformer to transform "SimpleDataType{type=org.mule.transport.NullPayload, mimeType='*/*'}" to "SimpleDataType{type=javax.xml.stream.XMLStreamReader, mimeType='*/*'}".

MuleSoft JIRA | Federico Boerr | 2 years ago
  1. 0

    The ESB fails to transform from NullPayload to XMLStreamReader (see error below). [NOTE: These connectors are developed with DevKit] For more than one connector, we found that a parameter of a connector's operation is taken from the mule message's #[payload]. This parameter either expects an instance of a particular class or a null/empty payload. As an example, take the following operation signature: @Processor public XMLStreamReader invokeServiceOperation( String apiOperation, @Payload XMLStreamReader input) throws Exception { Here are the 2 cases for different 'apiOperation', 'input': 1) has to be an XML: connector.invokeServiceOperation("create", xmlStreamReaderInstance); 2) has to be 'null'/empty connector.invokeServiceOperation("create", null); When testing both work. When running it in the ESB, case 1) works but case 2) fails with the error detailed below (Could not find a transformer). A] Is the solution to add a transformer from NullPayload to XMLStreamReader that just: 'return null'? B] Is there a way of generically fixing this for all similar operations? In the past, in order to overcome this, we defined the parameter as Object: @Processor public XMLStreamReader invokeServiceOperation( String apiOperation, @Payload Object input) throws Exception { XMLStreamReader xml = null; if (input instanceof XMLStreamReader) { xml = (XMLStreamReader) input; } But for this case, 'input' is created by DataMapper and the "if (input instanceof XMLStreamReader)" always returns false. This might be because the ESB passes whatever is in the payload to 'input' without the implicit transformation to XMLStreamReader. --------------- Error Description --------------- ******************************************************************************** Message : Could not find a transformer to transform "SimpleDataType{type=org.mule.transport.NullPayload, mimeType='*/*'}" to "SimpleDataType{type=javax.xml.stream.XMLStreamReader, mimeType='*/*'}". Code : MULE_ERROR-236 -------------------------------------------------------------------------------- Exception stack is: 1. Could not find a transformer to transform "SimpleDataType{type=org.mule.transport.NullPayload, mimeType='*/*'}" to "SimpleDataType{type=javax.xml.stream.XMLStreamReader, mimeType='*/*'}". (org.mule.api.transformer.TransformerException) org.mule.registry.MuleRegistryHelper:268 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transformer/TransformerException.html) -------------------------------------------------------------------------------- Root Exception stack trace: org.mule.api.transformer.TransformerException: Could not find a transformer to transform "SimpleDataType{type=org.mule.transport.NullPayload, mimeType='*/*'}" to "SimpleDataType{type=javax.xml.stream.XMLStreamReader, mimeType='*/*'}". at org.mule.registry.MuleRegistryHelper.lookupTransformer(MuleRegistryHelper.java:268) at org.mule.devkit.processor.ExpressionEvaluatorSupport.transform(ExpressionEvaluatorSupport.java:454) at org.mule.devkit.processor.ExpressionEvaluatorSupport.evaluateAndTransform(ExpressionEvaluatorSupport.java:273) + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything) ********************************************************************************

    MuleSoft JIRA | 2 years ago | Federico Boerr
    org.mule.api.transformer.TransformerException: Could not find a transformer to transform "SimpleDataType{type=org.mule.transport.NullPayload, mimeType='*/*'}" to "SimpleDataType{type=javax.xml.stream.XMLStreamReader, mimeType='*/*'}".
  2. 0

    The ESB fails to transform from NullPayload to XMLStreamReader (see error below). [NOTE: These connectors are developed with DevKit] For more than one connector, we found that a parameter of a connector's operation is taken from the mule message's #[payload]. This parameter either expects an instance of a particular class or a null/empty payload. As an example, take the following operation signature: @Processor public XMLStreamReader invokeServiceOperation( String apiOperation, @Payload XMLStreamReader input) throws Exception { Here are the 2 cases for different 'apiOperation', 'input': 1) has to be an XML: connector.invokeServiceOperation("create", xmlStreamReaderInstance); 2) has to be 'null'/empty connector.invokeServiceOperation("create", null); When testing both work. When running it in the ESB, case 1) works but case 2) fails with the error detailed below (Could not find a transformer). A] Is the solution to add a transformer from NullPayload to XMLStreamReader that just: 'return null'? B] Is there a way of generically fixing this for all similar operations? In the past, in order to overcome this, we defined the parameter as Object: @Processor public XMLStreamReader invokeServiceOperation( String apiOperation, @Payload Object input) throws Exception { XMLStreamReader xml = null; if (input instanceof XMLStreamReader) { xml = (XMLStreamReader) input; } But for this case, 'input' is created by DataMapper and the "if (input instanceof XMLStreamReader)" always returns false. This might be because the ESB passes whatever is in the payload to 'input' without the implicit transformation to XMLStreamReader. --------------- Error Description --------------- ******************************************************************************** Message : Could not find a transformer to transform "SimpleDataType{type=org.mule.transport.NullPayload, mimeType='*/*'}" to "SimpleDataType{type=javax.xml.stream.XMLStreamReader, mimeType='*/*'}". Code : MULE_ERROR-236 -------------------------------------------------------------------------------- Exception stack is: 1. Could not find a transformer to transform "SimpleDataType{type=org.mule.transport.NullPayload, mimeType='*/*'}" to "SimpleDataType{type=javax.xml.stream.XMLStreamReader, mimeType='*/*'}". (org.mule.api.transformer.TransformerException) org.mule.registry.MuleRegistryHelper:268 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transformer/TransformerException.html) -------------------------------------------------------------------------------- Root Exception stack trace: org.mule.api.transformer.TransformerException: Could not find a transformer to transform "SimpleDataType{type=org.mule.transport.NullPayload, mimeType='*/*'}" to "SimpleDataType{type=javax.xml.stream.XMLStreamReader, mimeType='*/*'}". at org.mule.registry.MuleRegistryHelper.lookupTransformer(MuleRegistryHelper.java:268) at org.mule.devkit.processor.ExpressionEvaluatorSupport.transform(ExpressionEvaluatorSupport.java:454) at org.mule.devkit.processor.ExpressionEvaluatorSupport.evaluateAndTransform(ExpressionEvaluatorSupport.java:273) + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything) ********************************************************************************

    MuleSoft JIRA | 2 years ago | Federico Boerr
    org.mule.api.transformer.TransformerException: Could not find a transformer to transform "SimpleDataType{type=org.mule.transport.NullPayload, mimeType='*/*'}" to "SimpleDataType{type=javax.xml.stream.XMLStreamReader, mimeType='*/*'}".
  3. 0

    couldn't get data while connecting mule with linkedin

    Stack Overflow | 2 years ago | user3855589
    org.mule.api.transformer.TransformerException: Could not find a transformer to transform "SimpleDataType{type=java.lang.String, mimeType='*/*'}" to "CollectionDataType{type=java.util.List, itemType=java.lang.Object, mimeType='*/*'}".
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Mule Error "Could not find a transformer" with Drupal Connector

    Stack Overflow | 3 years ago | dba
    org.mule.api.transformer.TransformerException: Could not find a transformer to transform "SimpleDataType{type=java.lang.String, mimeType='*/*'}" to "CollectionDataType{type=java.util.List, itemType=java.lang.Object, mimeType='*/*'}".
  6. 0

    Mule Magento Cloud Connector 2.0, Missing transformer?

    Stack Overflow | 4 years ago | Zavior
    org.mule.api.transformer.TransformerException: Could not find a transformer to transform "SimpleDataType{type=java.lang.String, mimeType='*/*'}" to "SimpleDataType{type=com.magento.api.AssociativeEntity, mimeType='*/*'}".

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.mule.api.transformer.TransformerException

      Could not find a transformer to transform "SimpleDataType{type=org.mule.transport.NullPayload, mimeType='*/*'}" to "SimpleDataType{type=javax.xml.stream.XMLStreamReader, mimeType='*/*'}".

      at org.mule.registry.MuleRegistryHelper.lookupTransformer()
    2. Mule Core
      MuleRegistryHelper.lookupTransformer
      1. org.mule.registry.MuleRegistryHelper.lookupTransformer(MuleRegistryHelper.java:268)
      1 frame
    3. org.mule.devkit
      ExpressionEvaluatorSupport.evaluateAndTransform
      1. org.mule.devkit.processor.ExpressionEvaluatorSupport.transform(ExpressionEvaluatorSupport.java:454)
      2. org.mule.devkit.processor.ExpressionEvaluatorSupport.evaluateAndTransform(ExpressionEvaluatorSupport.java:273)
      2 frames