huqian0456 opened a new issue, #16293:
URL: https://github.com/apache/dubbo/issues/16293

   ### Pre-check
   
   - [x] I am sure that all the content I provide is in English.
   
   
   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/dubbo/issues?q=is%3Aissue) and found no 
similar feature requirement.
   
   
   ### 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?
   
   - [ ] Yes I am willing to submit a pull request on my own!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to