Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Exception logged when calling RPC method with a null argument

    Isomorphic,

    We upgraded from 12.1p to 13.1p and started to see the following warning logged now:

    Code:
    2025-01-22-10:50:55:305 -0500 com.isomorphic.base.Reflection WARN [http-nio-8180-exec-10] Caught exception in typesAsString() trying to process argument with type 'null' and value [null]
    java.lang.NullPointerException: Cannot invoke "java.lang.Class.getName()" because "this.type" is null
        at com.isomorphic.base.ReflectionArgument.getClassName(ReflectionArgument.java:89) ~[isomorphic_core_rpc.jar:?]
        at com.isomorphic.base.Reflection.typesAsString(Reflection.java:1148) [isomorphic_core_rpc.jar:?]
        at com.isomorphic.base.Reflection.adaptArgsAndInvoke(Reflection.java:973) [isomorphic_core_rpc.jar:?]
        at com.isomorphic.base.Reflection.adaptArgsAndInvoke(Reflection.java:957) [isomorphic_core_rpc.jar:?]
        at com.isomorphic.rpc.RPCDMI.execute(RPCDMI.java:337) [isomorphic_core_rpc.jar:?]
        at com.isomorphic.rpc.RPCDMI.execute(RPCDMI.java:67) [isomorphic_core_rpc.jar:?]
        at com.isomorphic.rpc.RPCRequest.execute(RPCRequest.java:274) [isomorphic_core_rpc.jar:?]
        at com.isomorphic.servlet.IDACall.handleRPCRequest(IDACall.java:391) [isomorphic_core_rpc.jar:?]
    I noticed that it occurs when passing a null value for an Integer argument, however, there may be other types impacted. The RPC method does get invoked with a null value.

    Using SmartClient Version: v13.1p_2025-01-13/Pro Deployment (built 2025-01-13)

    Thanks

    #2
    It definitely should not crash like this - it should at least provide more information.

    However, can you provide some more information here - is this because you've got a POJO as a parameter to the target method? If so, what is the type of the field on the POJO? If it's Integer (with a capital "I") it's obvious that the inbound null should make the field null.

    If it's "int", there is no clear interpretation of null - silently changing it to 0 would be too dangerous.

    Comment

    Working...
    X