我得到错误,而0记录与拆分..有一个记录或多个记录,它工作正常 但如果没有拆分记录,则会出错 我收到了这个错误
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 -> #[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 :(得分:0)
它自我说你得到一个字符串作为分配器组件的输入导致问题。
确保为分割器组件提供可迭代的对象。