2016-03-30 56 views
0

我得到了错误,而0记录与拆分..With一个记录或多个记录它工作正常 但如果没有记录与拆分然后它给出错误 我得到这个错误错误处理零记录与拆分批处理:mule esb

org.mule.api.MessagingException: Object "java.lang.String" not of correct type. It must be of type "{interface java.lang.Iterable,interface java.util.Iterator,interface org.mule.routing.MessageSequence,interface java.util.Collection}" (java.lang.IllegalArgumentException) (com.mulesoft.module.batch.exception.BatchException). Message payload is of type: String at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:32) at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107) at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88) at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59) at org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:80) 

我的流程是遵循

<batch:job name="testBatch"> 
     <batch:input> 
      <component class="org.test.d1.Find" doc:name="Java"/> 
      <file:outbound-endpoint path="test" outputPattern="test.xml" responseTimeout="10000" doc:name="File"/> 

      <logger message="COUNT -&gt; #[xpath('fn:count(//po:Account)')]" level="INFO" doc:name="Logger"/> 
      <expression-filter expression="#[xpath('fn:count(//po:Account)')!=0.0]" doc:name="Expression"/> 
      <splitter evaluator="xpath" expression="//po:Account" doc:name="Splitter"/> 
      <collection-aggregator failOnTimeout="true" doc:name="Collection Aggregator"/> 
     </batch:input> 
     <batch:process-records> 
      <batch:step name="Batch_Step"> 
      </batch:step> 
     </batch:process-records> 
     <batch:on-complete> 
      <logger level="INFO" doc:name="Logger"/> 
      <set-payload value="Total Record : #[payload.totalRecords] fail Records : #[payload.failedRecords] successfull records :#[payload.successfulRecords +'\n'] " doc:name="Set Payload"/> 

     </batch:on-complete> 
    </batch:job> 

请帮我解决这个错误。谢谢

回答

0

它自我说你得到一个字符串作为输入到分解器组件导致的问题的异常。

确保你给一个分离器组件一个迭代对象。