You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@servicecomb.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/07/02 14:10:00 UTC

[jira] [Commented] (SCB-703) When consumer invoke void type method in RPC style, an exception is thrown

    [ https://issues.apache.org/jira/browse/SCB-703?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16529974#comment-16529974 ] 

ASF GitHub Bot commented on SCB-703:
------------------------------------

wujimin commented on a change in pull request #782: [SCB-703] Fix deserialization problem in invoking void operation in RPC style
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/782#discussion_r199509668
 
 

 ##########
 File path: common/common-javassist/src/main/java/org/apache/servicecomb/common/javassist/CtType.java
 ##########
 @@ -65,7 +65,7 @@ public CtType(JavaType javaType) {
   }
 
   private void init(CtClass ctClass, boolean hasGenericTypes, String genericSignature) {
-    if (ctClass.isPrimitive()) {
+    if (ctClass.isPrimitive() && !"void".equals(ctClass.getName())) {
 
 Review comment:
   void.class.getName?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> When consumer invoke void type method in RPC style, an exception is thrown
> --------------------------------------------------------------------------
>
>                 Key: SCB-703
>                 URL: https://issues.apache.org/jira/browse/SCB-703
>             Project: Apache ServiceComb
>          Issue Type: Bug
>          Components: Java-Chassis
>    Affects Versions: java-chassis-1.0.0-m2
>            Reporter: YaoHaishi
>            Assignee: YaoHaishi
>            Priority: Major
>             Fix For: java-chassis-1.0.0
>
>
> When consumer invoke provider in RPC style, and the return type of provider method is void, an exception is thrown because consumer attemp to deserialize null as void, error log is like below:
> {code:java}
> Caused by: java.lang.IllegalArgumentException: Internal error: can't find deserializer for void
> 	at com.fasterxml.jackson.databind.deser.std.NumberDeserializers.find(NumberDeserializers.java:109)
> 	at com.fasterxml.jackson.databind.deser.BasicDeserializerFactory.findDefaultDeserializer(BasicDeserializerFactory.java:1800)
> 	at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.findStdDeserializer(BeanDeserializerFactory.java:161)
> 	at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.createBeanDeserializer(BeanDeserializerFactory.java:125)
> 	at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer2(DeserializerCache.java:411)
> 	at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer(DeserializerCache.java:349)
> 	at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:264)
> 	... 28 more
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)