Migrating Mule 3.6 to Mule 3.7 NullPointerException calling method with null payload

[亡魂溺海] 提交于 2019-12-08 04:43:25

问题


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.

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()))) 

Because when payload is null arg is null.

Is this a bug?


回答1:


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 (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

    Now, in Mule 3.7.x:

  • MEL: Payload == null: true

  • MEL: Payload is NullPayload: false
  • MEL: Payload is org.mule.transport.NullPayload: false
  • Groovy: Payload instanceof org.mule.transport.NullPayload: true
  • Groovy: Payload == null: false


来源:https://stackoverflow.com/questions/35850469/migrating-mule-3-6-to-mule-3-7-nullpointerexception-calling-method-with-null-pay

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!