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

javassist.compiler.CompileError: setSkyWalkingDynamicField(java.lang.Object) #3996

Closed
4 tasks
YangXueJun opened this issue Dec 3, 2019 · 13 comments
Closed
4 tasks
Labels
question End user question and discussion.
Milestone

Comments

@YangXueJun
Copy link

Please answer these questions before submitting your issue.

  • Why do you submit this issue?
  • Question or discussion
  • Bug
  • Requirement
  • Feature or performance improvement

Question

  • What do you want to know?

Bug

  • Which version of SkyWalking, OS and JRE?

Dubbo version: 2.7.3
Operating System version: mac
Java version: 1.8
skywalking 6.4

  • What happen?

One service is exposed to Rest and dubbo at the same time, it will throw a RuntimeException.
(当一个服务类同时暴露成为一个dubbo服务和Rest服务时,会抛出一个RuntimeException)

code

@RestController
@Service
public class ProviderDemoServiceImpl implements ProviderDemoService {


    @Autowired
    private GoodsStorageMapper goodsStorageMapper;

    /**
     * 描述功能
     * @param helloReqDto
     * @return HelloResDto
     * @author yangxuejun
     * @date 2019/11/26 上午10:48
     **/
    @Override
    public HelloResDto hello(HelloReqDto helloReqDto) {

        log.info(JSON.toJSONString(helloReqDto));

      

        return new HelloResDto("I'am fine!");
    }
}


error log

java.lang.RuntimeException: [source error] setSkyWalkingDynamicField(java.lang.Object) not found in com.topology.mamaezhan.cloud.pdemo.service.application.service.impl.ProviderDemoServiceImpl
	at org.apache.dubbo.common.bytecode.ClassGenerator.toClass(ClassGenerator.java:348)
	at org.apache.dubbo.common.bytecode.ClassGenerator.toClass(ClassGenerator.java:287)
	at org.apache.dubbo.common.bytecode.Wrapper.makeWrapper$original$POGqGkKA(Wrapper.java:261)
	at org.apache.dubbo.common.bytecode.Wrapper.makeWrapper$original$POGqGkKA$accessor$taGwTSLo(Wrapper.java)
	at org.apache.dubbo.common.bytecode.Wrapper$auxiliary$azLLPFgY.call(Unknown Source)
	at org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.StaticMethodsInter.intercept(StaticMethodsInter.java:86)
	at org.apache.dubbo.common.bytecode.Wrapper.makeWrapper(Wrapper.java)
	at org.apache.dubbo.common.bytecode.Wrapper.getWrapper(Wrapper.java:118)
	at org.apache.dubbo.rpc.proxy.javassist.JavassistProxyFactory.getInvoker(JavassistProxyFactory.java:41)
	at org.apache.dubbo.rpc.proxy.wrapper.StubProxyFactoryWrapper.getInvoker(StubProxyFactoryWrapper.java:118)
	at org.apache.dubbo.rpc.ProxyFactory$Adaptive.getInvoker(ProxyFactory$Adaptive.java)
	at org.apache.dubbo.config.ServiceConfig.exportLocal(ServiceConfig.java:641)
	at org.apache.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:576)
	at org.apache.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:457)
	at org.apache.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:415)
	at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:378)
	at org.apache.dubbo.config.spring.ServiceBean.export(ServiceBean.java:336)
	at org.apache.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:114)
	at org.apache.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:60)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:402)
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:359)
	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:896)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:161)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:742)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:389)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:311)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1213)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1202)
	at com.topology.mamaezhan.cloud.providerdemo.launcher.ProviderDemoLauncher.main(ProviderDemoLauncher.java:21)
Caused by: javassist.CannotCompileException: [source error] setSkyWalkingDynamicField(java.lang.Object) not found in com.topology.mamaezhan.cloud.pdemo.service.application.service.impl.ProviderDemoServiceImpl
	at javassist.CtNewMethod.make(CtNewMethod.java:79)
	at javassist.CtNewMethod.make(CtNewMethod.java:45)
	at org.apache.dubbo.common.bytecode.ClassGenerator.toClass(ClassGenerator.java:323)
	... 33 common frames omitted
Caused by: javassist.compiler.CompileError: setSkyWalkingDynamicField(java.lang.Object) not found in com.topology.mamaezhan.cloud.pdemo.service.application.service.impl.ProviderDemoServiceImpl
	at javassist.compiler.TypeChecker.atMethodCallCore(TypeChecker.java:749)
	at javassist.compiler.TypeChecker.atCallExpr(TypeChecker.java:695)
	at javassist.compiler.JvstTypeChecker.atCallExpr(JvstTypeChecker.java:157)
	at javassist.compiler.ast.CallExpr.accept(CallExpr.java:46)
	at javassist.compiler.CodeGen.doTypeCheck(CodeGen.java:242)
	at javassist.compiler.CodeGen.atStmnt(CodeGen.java:330)
	at javassist.compiler.ast.Stmnt.accept(Stmnt.java:50)
	at javassist.compiler.CodeGen.atStmnt(CodeGen.java:351)
	at javassist.compiler.ast.Stmnt.accept(Stmnt.java:50)
	at javassist.compiler.CodeGen.atIfStmnt(CodeGen.java:398)
	at javassist.compiler.CodeGen.atStmnt(CodeGen.java:355)
	at javassist.compiler.ast.Stmnt.accept(Stmnt.java:50)
	at javassist.compiler.CodeGen.atStmnt(CodeGen.java:351)
	at javassist.compiler.ast.Stmnt.accept(Stmnt.java:50)
	at javassist.compiler.CodeGen.atMethodBody(CodeGen.java:292)
	at javassist.compiler.CodeGen.atMethodDecl(CodeGen.java:274)
	at javassist.compiler.ast.MethodDecl.accept(MethodDecl.java:44)
	at javassist.compiler.Javac.compileMethod(Javac.java:169)
	at javassist.compiler.Javac.compile(Javac.java:95)
	at javassist.CtNewMethod.make(CtNewMethod.java:74)
	... 35 common frames omitted
@wu-sheng
Copy link
Member

wu-sheng commented Dec 3, 2019

Please search Dubbo bug. This should be fixed already in Dubbo side. This is dubbo lib bug.

@wu-sheng wu-sheng closed this as completed Dec 3, 2019
@wu-sheng wu-sheng added this to the 6.6.0 milestone Dec 3, 2019
@wu-sheng wu-sheng added the question End user question and discussion. label Dec 3, 2019
@YangXueJun
Copy link
Author

YangXueJun commented Dec 4, 2019

I used the latest version dubbo (Spring Cloud Alibaba Dubbo). It do well when I exposd a service to REST or Dubbo independently.

@wu-sheng
Copy link
Member

wu-sheng commented Dec 4, 2019

I think you should submit this to Dubbo to ask why. And you could keep in the loop on that issue. I am really not familiar about the difference between these two cases in Dubbo.

@YangXueJun
Copy link
Author

Ok,Thinks your reply.

@shenhongbin7854
Copy link

这个目前

Dubbo version: 2.7.3
Operating System version: mac
Java version: 1.8
skywalking 6.4

有好的解决办法么?
除了区dubbo提bug,升级skywalking能解决?
在不升级dubbo的情况下

@wu-sheng
Copy link
Member

wu-sheng commented Dec 4, 2019

@shenhongbin7854 Discussion in English only

@shenhongbin7854
Copy link

env:
Dubbo version: 2.7.3
Operating System version: centos7
Java version: 1.8
skywalking 6.4

error: Same as above
1 We want to solve this problem
and use skywalking agent
2 but We don't want to upgrade dubbo version

Is there any other plan?
eg:upgrade skywalking?

@shenhongbin7854
Copy link

I think you should submit this to Dubbo to ask why. And you could keep in the loop on that issue. I am really not familiar about the difference between these two cases in Dubbo.

Upgraded version? Please tell me。 thanks

@shenhongbin7854
Copy link

I used the latest version dubbo (Spring Cloud Alibaba Dubbo). It do well when I exposd a service to REST or Dubbo independently.

Upgraded version? Please tell me。 thanks

@YangXueJun
Copy link
Author

YangXueJun commented Dec 4, 2019

I think you should submit this to Dubbo to ask why. And you could keep in the loop on that issue. I am really not familiar about the difference between these two cases in Dubbo.

Upgraded version? Please tell me。 thanks

upgrade can not solves your problem.You choose one way between Dubbo or Rest。
升级无法解决问题,你要么选择Dubbo,要么选择Rest

@shenhongbin7854
Copy link

service only use rpc or only use http ?

@shenhongbin7854
Copy link

I think you should submit this to Dubbo to ask why. And you could keep in the loop on that issue. I am really not familiar about the difference between these two cases in Dubbo.

Upgraded version? Please tell me。 thanks

upgrade can not solves your problem.You choose one way between Dubbo or Rest。
升级无法解决问题,你要么选择Dubbo,要么选择Rest

service only use rpc or only use http ?

@zifeihan
Copy link
Member

zifeihan commented Apr 7, 2021

For more information about this bug in dubbo, please see, apache/dubbo#7517 , and this pr will fix this bug.

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

No branches or pull requests

4 participants