Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mule ESB error >> "There are two transformers that are an exact match for input

I am a newbie in Mule.

I try to create a simple login flow with SOAP that will return XML Response. My method is send the data with XML and then i save the login data in the transformation code, after save the data, the return data will be generated to xml response. but i have errors with " There are two transformers that are an exact match for input". I dont understand why it happen. Please Help me to solve this problems.

This is my flow code :

<http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" 

port="8081" doc:name="HTTP Listener Configuration"/>
<cxf:configuration name="CXF_Configuration" enableMuleSoapHeaders="true" initializeStaticBusInstance="true" doc:name="CXF Configuration"/>
<mulexml:jaxb-context name="myJaxb" packageNames="com.test.service" doc:name="JAXB Context"/>

<flow name="LoginFlow" initialState="started">
<http:listener config-ref="HTTP_Listener_Configuration" path="/Login" doc:name="HTTP"/>
<cxf:proxy-service configuration-ref="CXF_Configuration" doc:name="CXF" namespace="http://www.test.co.id/SOA/service/1.0" payload="body" port="LoginPort" service="LoginService" wsdlLocation="service/login-test.wsdl"/>
<logger message="#[payload]" level="INFO" doc:name="Logger"/>
<mulexml:dom-to-xml-transformer returnClass="java.lang.String" doc:name="DOM to XML"/>
<logger message="#[payload]" level="INFO" doc:name="Logger"/>
<custom-transformer class="com.test.transform.XMLTransform" doc:name="XML To Java" returnClass="com.test.service.LoginResponse"/>
<mulexml:jaxb-object-to-xml-transformer jaxbContext-ref="myJaxb" doc:name="JAXB Object to XML"/>
<mulexml:xml-to-dom-transformer doc:name="XML to DOM"/>
</flow>

Error Stack :

1. There are two transformers that are an exact match for input: "class org.mule.module.cxf.CxfInboundMessageProcessor$1", output: "class [B". Transformers are: "XmlToByteArray(class org.mule.module.xml.transformer.XmlToDomDocument)" and "_ObjectToByteArray(class org.mule.transformer.simple.ObjectToByteArray)" (org.mule.api.registry.ResolverException)
org.mule.registry.TypeBasedTransformerResolver:166 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/registry/ResolverException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
org.mule.api.registry.ResolverException: There are two transformers that are an exact match for input: "class org.mule.module.cxf.CxfInboundMessageProcessor$1", output: "class [B". Transformers are: "XmlToByteArray(class org.mule.module.xml.transformer.XmlToDomDocument)" and "_ObjectToByteArray(class org.mule.transformer.simple.ObjectToByteArray)"
at org.mule.registry.TypeBasedTransformerResolver.getNearestTransformerMatch(TypeBasedTransformerResolver.java:166)
at org.mule.registry.TypeBasedTransformerResolver.resolve(TypeBasedTransformerResolver.java:100)
at org.mule.registry.MuleRegistryHelper.resolveTransformer(MuleRegistryHelper.java:283)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)

Thanks for the answers. :)

like image 250
mauwahid Avatar asked Oct 31 '22 06:10

mauwahid


2 Answers

i suspect this is due to DOM-to-XML component at the end. can you remove this and try because you have Jaxb-to-xml component before DOM-to-XML

like image 159
Anil Avatar answered Nov 09 '22 14:11

Anil


had the same error message and I fixed it by setting the mime type of the object-to-json transformer before a dataweave that was generating the issue in Munit

like image 32
Rene Lucena Avatar answered Nov 09 '22 13:11

Rene Lucena