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

MetadataReportService 使用Class.forName loadclass #4712

Closed
2 tasks
fangxiaorui opened this issue Aug 1, 2019 · 3 comments · Fixed by #4767
Closed
2 tasks

MetadataReportService 使用Class.forName loadclass #4712

fangxiaorui opened this issue Aug 1, 2019 · 3 comments · Fixed by #4767
Milestone

Comments

@fangxiaorui
Copy link

fangxiaorui commented Aug 1, 2019

  • I have searched the issues of this repository and believe that this is not a duplicate.
  • I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version: xxx
  • Operating System version: centos 7
  • Java version: 1.8.0

Steps to reproduce this issue

Class.forName 使用的MetadataReportService 的classloader 来加载interface,
但是这个interface 可能是另外的class loader 加载的,会报找不到class.

2019-08-01 12:15:26,110 ERROR org.apache.dubbo.metadata.integration.MetadataReportService[106] -  [DUBBO] publishProvider getServiceDescriptor error. providerUrl: dubbo://192.168.0.9:20880/com.wdk.SpiTes?anyhost=true&application=wdk-plugin-engine&dubbo=2.0.2&generic=false&group=dubbo&interface=com.wdk.SpiTes&methods=speak&proxy=jdk&release=2.7.1-SNAPSHOT&revision=1.0.0-SNAPSHOT&side=provider&version=1.0.0.wdk-serverless-bundle.1.0.0, dubbo version: 2.7.1-SNAPSHOT, current host: 192.168.0.9
java.lang.ClassNotFoundException: com.wdk.SpiTes

Pls. provide [GitHub address] to reproduce this issue.

Expected Result

What do you expected from the above steps?

Actual Result

What actually happens?

If there is an exception, please attach the exception trace:

Just put your stack trace here!
@cvictory
Copy link
Contributor

cvictory commented Aug 1, 2019

I think I will add some code such as Thread.getContextClassLoader to fix this issue.

You should add some code java.lang.Thread#setContextClassLoader. Please make sure you can do it.

@fangxiaorui
Copy link
Author

yean , now I had change the code with 2.7.0 source code . use Thread context class loader

@beiwei30
Copy link
Member

beiwei30 commented Aug 1, 2019

yean , now I had change the code with 2.7.0 source code . use Thread context class loader

@fangxiaorui Let me know if you are interested in fixing this particular issue by submitting a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants