使用有效负载为空将Mule 3.6迁移到Mule 3.7 NullPointerException调用方法 [英] Migrating Mule 3.6 to Mule 3.7 NullPointerException calling method with null payload
问题描述
我正在将我的m子项目从3.6版迁移到3.7版.在3.6版中,我能够使用调用程序来调用将有效负载作为参数传递的方法.
I'm migrating my mule project from version 3.6 to 3.7. In version 3.6 I was able to use invoker calling a method passing payload as an argument.
现在在3.7版中,如果我这样做,则当有效负载为null
时,在类InvokerMessageProcessor
的第272行中,当执行以下测试时,得到NullPointerException
:
Now in version 3.7 if I do that I get NullPointerException
, when payload is null
, in class InvokerMessageProcessor
, line 272, when the following test is executed:
if (!(type.isAssignableFrom(arg.getClass())))
因为有效负载为null
arg
为null
.
这是一个错误吗?
推荐答案
实际上,M子对待 emptiness 和null
值的方式从M子3.6+变为3.7+,这是 Mule 3.6.x 中针对不同类型的处理器和组件进行验证的方式:
In fact, there was a change in the way Mule treats emptiness and null
values from Mule 3.6+ to 3.7+, This is the way the validations used to be in Mule 3.6.x for different kind of processors and components:
- MEL(M子表达语言):
Payload == null
:false - MEL:
Payload is NullPayload
:是 - MEL:
Payload is org.mule.transport.NullPayload
:是 - 时髦:
Payload instanceof org.mule.transport.NullPayload
:是 -
时髦:
Payload == null
:错误
- MEL (Mule Expression Language):
Payload == null
: false - MEL:
Payload is NullPayload
: true - MEL:
Payload is org.mule.transport.NullPayload
: true - Groovy:
Payload instanceof org.mule.transport.NullPayload
: true Groovy:
Payload == null
: false
现在,在 Mule 3.7.x 中:
MEL:Payload == null
:是
这篇关于使用有效负载为空将Mule 3.6迁移到Mule 3.7 NullPointerException调用方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!