apache / skywalking

APM, Application Performance Monitoring System
https://skywalking.apache.org/
Apache License 2.0
23.86k stars 6.52k forks source link

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

Closed YangXueJun closed 4 years ago

YangXueJun commented 4 years ago

Please answer these questions before submitting your issue.


Question


Bug

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

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 commented 4 years ago

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

YangXueJun commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

Ok,Thinks your reply.

shenhongbin7854 commented 4 years ago

这个目前

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

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

wu-sheng commented 4 years ago

@shenhongbin7854 Discussion in English only

shenhongbin7854 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

service only use rpc or only use http ?

shenhongbin7854 commented 4 years ago

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 commented 3 years ago

For more information about this bug in dubbo, please see, https://github.com/apache/dubbo/pull/7517 , and this pr will fix this bug.