Pre-check
Search before asking
Apache Dubbo Component
Java SDK (apache/dubbo)
Descriptions
When calling a Dubbo service with a parameter that does not implement java.io.Serializable, the request fails with a confusing NullPointerException.
java.lang.NullPointerException: Cannot invoke "Object.hashCode()" because "key" is null
at java.util.concurrent.ConcurrentHashMap.get(...)
at org.apache.dubbo.rpc.support.GroupServiceKeyCache.getServiceKey(...)
at org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol.getInvoker(...)
Root Cause:
The actual problem is that the entity class is not Serializable.
Adding implements Serializablefixes the issue immediately.
Expected Behavior:
Dubbo should throw a clear exception (e.g. NotSerializableException) instead of an internal NPE.
Suggestion:
Fail fast with a meaningful error message indicating which class is not serializable.
Related issues
No response
Are you willing to submit a pull request to fix on your own?
Code of Conduct
Pre-check
Search before asking
Apache Dubbo Component
Java SDK (apache/dubbo)
Descriptions
When calling a Dubbo service with a parameter that does not implement java.io.Serializable, the request fails with a confusing NullPointerException.
java.lang.NullPointerException: Cannot invoke "Object.hashCode()" because "key" is null
at java.util.concurrent.ConcurrentHashMap.get(...)
at org.apache.dubbo.rpc.support.GroupServiceKeyCache.getServiceKey(...)
at org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol.getInvoker(...)
Root Cause:
The actual problem is that the entity class is not Serializable.
Adding implements Serializablefixes the issue immediately.
Expected Behavior:
Dubbo should throw a clear exception (e.g. NotSerializableException) instead of an internal NPE.
Suggestion:
Fail fast with a meaningful error message indicating which class is not serializable.
Related issues
No response
Are you willing to submit a pull request to fix on your own?
Code of Conduct