#[process:processName:valueToProcess]
フローで式を使用しようとしています。
これは私のフロー設定です:
<flow name="exampleFlow">
<quartz:inbound-endpoint jobName="job1" cronExpression="0/5 * * * * ?" connector-ref="quartzConnector">
<quartz:event-generator-job>
<quartz:payload>foo</quartz:payload>
</quartz:event-generator-job>
</quartz:inbound-endpoint>
<logger message="#[process:test:#[payload]]" level="INFO"/>
</flow>
<sub-flow name="test" doc:name="test">
<component class="com.myComp.ComponentTest" doc:name="Java"/>
</sub-flow>
そしてこれは私のJavaコンポーネントです:
package com.myComp;
public class ComponentTest
{
public String test(String s)
{
return s + "bar";
}
}
#[process:test:#[payload]]
式が評価されるときに問題が発生します。この例外がスローされます。
java.lang.NullPointerException
at org.mule.component.AbstractComponent.invokeInternal(AbstractComponent.java:112)
at org.mule.component.AbstractComponent.process(AbstractComponent.java:156)
at org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:99)
at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:66)
at org.mule.processor.chain.InterceptingChainLifecycleWrapper.doProcess(InterceptingChainLifecycleWrapper.java:56)
at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:66)
at org.mule.processor.chain.InterceptingChainLifecycleWrapper.process(InterceptingChainLifecycleWrapper.java:87)
at org.mule.api.processor.MessageProcessors$LifecyleAwareMessageProcessorWrapper.process(MessageProcessors.java:114)
at org.mule.expression.MessageProcessorExpressionEvaluator.evaluate(MessageProcessorExpressionEvaluator.java:87)
at org.mule.expression.DefaultExpressionManager.evaluate(DefaultExpressionManager.java:273)
at org.mule.expression.DefaultExpressionManager.evaluate(DefaultExpressionManager.java:209)
at org.mule.expression.DefaultExpressionManager$1.match(DefaultExpressionManager.java:399)
at org.mule.util.TemplateParser.parse(TemplateParser.java:156)
at org.mule.util.TemplateParser.parse(TemplateParser.java:133)
at org.mule.expression.DefaultExpressionManager.parse(DefaultExpressionManager.java:395)
at org.mule.expression.DefaultExpressionManager.parse(DefaultExpressionManager.java:379)
at org.mule.api.processor.LoggerMessageProcessor.log(LoggerMessageProcessor.java:89)
at org.mule.api.processor.LoggerMessageProcessor.process(LoggerMessageProcessor.java:71)
at org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:99)
at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:66)
at org.mule.processor.AbstractInterceptingMessageProcessorBase.processNext(AbstractInterceptingMessageProcessorBase.java:105)
at org.mule.interceptor.AbstractEnvelopeInterceptor.process(AbstractEnvelopeInterceptor.java:55)
at org.mule.processor.AsyncInterceptingMessageProcessor.processNextTimed(AsyncInterceptingMessageProcessor.java:111)
at org.mule.processor.AsyncInterceptingMessageProcessor$AsyncMessageProcessorWorker.doRun(AsyncInterceptingMessageProcessor.java:158)
at org.mule.work.AbstractMuleEventWork.run(AbstractMuleEventWork.java:43)
at org.mule.work.WorkerContext.run(WorkerContext.java:310)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
他のスクリプトコンポーネントでも同じことが起こります。コンポーネントのライフサイクルと関係があると思いますが、動作させる方法が見つかりませんでした。コンポーネントを他のMuleプロセッサ(ロガー、stringAppendなど)と交換すると、正常に動作します。
どんな助けでもありがたいです!