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

Error NullPointerException occurred when call service from one biz to another #479

Closed
ggndnn opened this issue Sep 13, 2019 · 3 comments
Closed
Labels
question Further information is requested

Comments

@ggndnn
Copy link

ggndnn commented Sep 13, 2019

Based on sofa-boot(v3.2.0) and sofa-ark(v1.0.0), when one biz tried to call a service from another biz, got a error:

java.lang.NullPointerException: null
    at com.alipay.sofa.runtime.invoke.DynamicJvmServiceProxyFinder.getBiz(DynamicJvmServiceProxyFinder.java:149) ~[runtime-sofa-boot-3.2.0.jar:na]
    at com.alipay.sofa.runtime.invoke.DynamicJvmServiceProxyFinder.findServiceProxy(DynamicJvmServiceProxyFinder.java:79) ~[runtime-sofa-boot-3.2.0.jar:na]
    at com.alipay.sofa.runtime.service.binding.JvmBindingAdapter$JvmServiceInvoker.doInvoke(JvmBindingAdapter.java:168) ~[runtime-sofa-boot-3.2.0.jar:na]
    at com.alipay.sofa.runtime.spi.service.ServiceProxy.invoke(ServiceProxy.java:40) ~[runtime-sofa-boot-3.2.0.jar:na]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.1.8.RELEASE.jar:5.1.8.RELEASE]
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) ~[spring-aop-5.1.8.RELEASE.jar:5.1.8.RELEASE]
...

After analysis, I found this is caused by that com.alipay.sofa.runtime.invoke.DynamicJvmServiceProxyFinder was not exported by runtime-sofa-boot-plugin. The bizManagerService in DynamicJvmServiceProxyFinder loaded by bizClassLoaded did not have a chance to be injected.

Sofa-boot v3.1.5 did not have such issue, because runtime-sofa-boot-plugin exported package com.alipay.sofa.runtime.integration where DynamicJvmServiceProxyFinder was inside then.

SofaEventHandler is the same as DynamicJvmServiceProxyFinder, different from v3.1.5. And dependency hessian should be added to runtime-sofa-boot-plugin too.

I think the big reform of code organization in sofa-boot v3.2.0 brought some impact on sofa-ark at least.

@glmapper
Copy link
Contributor

can you peovide a simple demo to show this bug?

@ggndnn
Copy link
Author

ggndnn commented Sep 14, 2019

@glmapper
Copy link
Contributor

glmapper commented Nov 1, 2019

@ggndnn just upgrade SOFABoot version to 3.2.1-SNAPSHOT and upgrade the SOFAArk version to 1.1.0-SNAPSHOT. if there any other problem, you can reopen this issue again.

@glmapper glmapper closed this as completed Nov 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants