Error - Cannot apply transformer ObjectToHttpClientMethodRequest

555 views Asked by At
<flow name="initiateAutobulkFlow" doc:name="initiateAutobulkFlow">
   <jms:inbound-endpoint queue="${queue.name}" connector-ref="Active_MQ" doc:name="JMS Message Listener"/>
    <set-variable variableName="createListings" value="#[new com.xyz.domain.inventory.v2.bulk.DTO.BulkListingRequest()]" doc:name="New Listings to Create"/> 
    <choice doc:name="Choice">
        <when expression="ablInputMessage['oldFilePath'] == empty">
            <component class="com.xyz.app.integration.autobulk.ComputeFileDiff" doc:name="Java"/>
            <set-payload value="#[flowVars['createListings']]" doc:name="Set Payload"/>
            <foreach collection="#[payload]" batchSize="2" doc:name="For Each">
                <logger message="#[payload]" level="INFO" doc:name="Logger"/>
                <foreach doc:name="For Each" >
                    <logger message="#[payload]" level="INFO" doc:name="Logger"/>
                   <https:outbound-endpoint exchange-pattern="request-response" method="GET" connector-ref="HttpsClientConnector" address="//api-dev.xyz.com/search/catalog/events/ship/v3/?locale=en_US&amp;venueName=SAP Center&amp;eventDateLocal=2015-11-11T19:30" contentType="application/json" doc:name="Invoke Search Events API">
                    <message-properties-transformer scope="outbound"> 
                       <add-message-property key="Authorization" value="Bearer dd39"/>  
                       <add-message-property key="Content-Type" value="application/json"/>  
                       <add-message-property key="TARGET_HOST" value="${target.host}"/> 
                    </message-properties-transformer>
                   </https:outbound-endpoint>
                    <logger message="@@@@@@" level="INFO" doc:name="Logger"/>
                <echo-component doc:name="Echo"/>
                </foreach>
            </foreach>
            <otherwise>
            <flow-ref name="computeFileDiffAndProcessBulkListingUpdateReq" doc:name="Perform File Difference And Process Bulk Update Req"/>
        </otherwise>
    </choice>
    </flow>

createListings is an ArrayList of ListingRequest objects

I am getting these messages -

INFO  2015-06-14 19:46:37,729 [[autobulk].initiateAutobulkFlow.stage1.02] org.mule.api.processor.LoggerMessageProcessor:org.mule.api.processor.LoggerMessageProcessor: [com.xyz.domain.inventory.v2.DTO.ListingRequest@136e2b70, com.xyz.domain.inventory.v2.DTO.ListingRequest@25e5d007]
INFO  2015-06-14 19:46:37,729 [[autobulk].initiateAutobulkFlow.stage1.02] org.mule.api.processor.LoggerMessageProcessor:org.mule.api.processor.LoggerMessageProcessor: com.xyz.domain.inventory.v2.DTO.ListingRequest@136e2b70
INFO  2015-06-14 19:46:37,731 [[autobulk].initiateAutobulkFlow.stage1.02] org.mule.transport.service.DefaultTransportServiceDescriptor: Loading default outbound transformer: org.mule.transport.http.transformers.ObjectToHttpClientMethodRequest
INFO  2015-06-14 19:46:37,731 [[autobulk].initiateAutobulkFlow.stage1.02] org.mule.transport.service.DefaultTransportServiceDescriptor: Loading default response transformer: org.mule.transport.http.transformers.MuleMessageToHttpResponse
INFO  2015-06-14 19:46:37,731 [[autobulk].initiateAutobulkFlow.stage1.02] org.mule.transport.service.DefaultTransportServiceDescriptor: Loading default outbound transformer: org.mule.transport.http.transformers.ObjectToHttpClientMethodRequest
INFO  2015-06-14 19:46:37,732 [[autobulk].initiateAutobulkFlow.stage1.02] org.mule.lifecycle.AbstractLifecycleManager: Initialising: 'HttpsClientConnector.dispatcher.112861921'. Object is: HttpsClientMessageDispatcher
INFO  2015-06-14 19:46:37,732 [[autobulk].initiateAutobulkFlow.stage1.02] org.mule.lifecycle.AbstractLifecycleManager: Starting: 'HttpsClientConnector.dispatcher.112861921'. Object is: HttpsClientMessageDispatcher
INFO  2015-06-14 19:46:37,756 [[autobulk].initiateAutobulkFlow.stage1.02] org.mule.module.xml.transformer.jaxb.JAXBContextResolver: No common Object of type 'class javax.xml.bind.JAXBContext' configured, creating a local one for: SimpleDataType{type=com.xyz.domain.inventory.v2.DTO.ListingRequest, mimeType='*/*'}, SimpleDataType{type=org.mule.api.MuleMessage, mimeType='*/*'}
WARN  2015-06-14 19:46:37,932 [[autobulk].initiateAutobulkFlow.stage1.02] org.mule.module.xml.transformer.jaxb.JAXBContextResolver: 2 counts of IllegalAnnotationExceptions. Initializing context using JAXB annotated class: class com.xyz.domain.inventory.v2.DTO.ListingRequest

Root Exception stack trace:
java.lang.IllegalArgumentException: Cannot apply transformer ObjectToHttpClientMethodRequest

I have no real clue why this code is failing, and what these messages mean.

1

There are 1 answers

1
David Dossot On

Maybe unrelated but this is wrong:

<when expression="#[payload.getEvent().getVenue()==null">

A closing ] is missing. Also, this is MEL, so you can skip the gets:

<when expression="#[payload.event.venue==null]">

You can also simplify:

collection="#[flowVars['createListings']]"

into:

collection="#[createListings]"