Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE when invoke asynchronously use JdkProxy. #75

Closed
ujjboy opened this issue May 2, 2018 · 0 comments
Closed

NPE when invoke asynchronously use JdkProxy. #75

ujjboy opened this issue May 2, 2018 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@ujjboy
Copy link
Member

ujjboy commented May 2, 2018

It will throw NPE when invoke asynchronously use JDKProxy. the demo case like this:

public interface AllTypeService {
    public int echoInt(int i);
}
ConsumerConfig<AllTypeService> aConsumer = new ConsumerConfig<AllTypeService>()
       .setInterfaceId(AllTypeService.class.getName())
       .setProxy("jdk")
       .setInvokeType(RpcConstants.INVOKER_TYPE_FUTURE)
AllTypeService helloService2 = aConsumer.refer();
helloService2.echoInt(1); // will throw NPE 

The reason for this bug is appResponse of SofaResponse is null when async invoke. We need set default return value when the return type is primitive class.

PS: JavassistProxy is ok.

@ujjboy ujjboy added the bug Something isn't working label May 2, 2018
@ujjboy ujjboy self-assigned this May 2, 2018
@ujjboy ujjboy added this to the 5.3.2 milestone May 3, 2018
@ujjboy ujjboy closed this as completed May 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant