Migrating Mule 3.6 to Mule 3.7 NullPointerExceptio

2019-06-05 23:39发布

问题:

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


标签: mule mule-el