<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&venueName=SAP Center&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
是ArrayList
个ListingRequest
个对象
我收到这些消息 -
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
我不知道为什么这段代码失败了,这些消息意味着什么。
答案 0 :(得分:0)
也许无关,但这是错误的:
@using (Html.BeginForm("Upload", "mnis", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
@*<div>
<label for="file">Filename:</label></div>
<div class="uploadfirst">
<input type="file" name="file" id="file" /></div>
@Html.Label("lbl", "PSITE_SLNO");
<input id="Text1" name="txtsln" type="text" />
<div class="upload">
<input value="Submit" type="submit" /></div>*@
<table>
<tr><td><label for="file">Filename:</label></td><td><input type="file" name="file" id="file" /></td></tr>
<tr><td></td><td class="positions"><input value="Submit" type="submit" /></td></tr>
</table>
}
CONTROLLER
[HttpPost]
public ActionResult Upload(HttpPostedFileBase file)
{
try
{
if (file.ContentLength > 0)
{
int slno = (int)(Session["slnum"]);
string st = file.FileName.ToString();
//st = Server.MapPath("~/")+st;
st = Path.Combine(Server.MapPath("~/"), st);
file.SaveAs(st);
//Start(st, slno);
Task.Factory.StartNew(() =>
{
Thread.CurrentThread.Name = "Maximo thread";
Start(st, slno);
});
var fileName = Path.GetFileName(file.FileName);
var path = Path.Combine(Server.MapPath("~/App_Data/uploads"), fileName);
RedirectToAction("Index");
// file.SaveAs(path);
}
}
缺少结束<when expression="#[payload.getEvent().getVenue()==null">
。此外,这是MEL,因此您可以跳过]
s:
get
您还可以简化:
<when expression="#[payload.event.venue==null]">
成:
collection="#[flowVars['createListings']]"