org.mule.api.transformer.TransformerException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • 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) ********************************************************************************
    via by Federico Boerr,
  • 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) ********************************************************************************
    via by Federico Boerr,
  • I try to log using the logger component and if I use the expression #[mule:payload] it complains but if I use #[payload] it works fine. [10-02 16:09:30] ERROR DefaultMessagingExceptionStrategy [[javaone2011mule32].connector.http.mule.default.receiver.02]: ******************************************************************************** Message : Could not find a transformer to transform "SimpleDataType{type=org.codehaus.jackson.node.ArrayNode, mimeType='*/*'}" to "SimpleDataType{type=org.mule.api.transport.OutputHandler, mimeType='*/*'}". Code : MULE_ERROR-65237 -------------------------------------------------------------------------------- Exception stack is: 1. Could not find a transformer to transform "SimpleDataType{type=org.codehaus.jackson.node.ArrayNode, mimeType='*/*'}" to "SimpleDataType{type=org.mule.api.transport.OutputHandler, mimeType='*/*'}". (org.mule.api.transformer.TransformerException) org.mule.registry.MuleRegistryHelper:252 (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.codehaus.jackson.node.ArrayNode, mimeType='*/*'}" to "SimpleDataType{type=org.mule.api.transport.OutputHandler, mimeType='*/*'}". at org.mule.registry.MuleRegistryHelper.lookupTransformer(MuleRegistryHelper.java:252) at org.mule.DefaultMuleMessage.getPayload(DefaultMuleMessage.java:354) at org.mule.DefaultMuleMessage.getPayload(DefaultMuleMessage.java:312) + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything) ********************************************************************************
    via by Ken Yagen,
    • 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)

    Users with the same issue

    Unknown visitor1 times, last one,