You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "RTxin (via GitHub)" <gi...@apache.org> on 2023/03/10 13:26:54 UTC

[GitHub] [skywalking] RTxin opened a new issue, #10526: [Bug] After open the {SW AGENT CACHE CLASS}, is still an error 【net. Bytebuddy. Pool. TypePool $$NoSuchTypeException Resolution: Cannot resolve type description for org.apache.thrift.TServiceClient$auxiliary$JnOx25xa】

RTxin opened a new issue, #10526:
URL: https://github.com/apache/skywalking/issues/10526

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/skywalking/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Apache SkyWalking Component
   
   Java Agent (apache/skywalking-java)
   
   ### What happened
   
   ### First Problem
   - I used Skywalking and another Agent made with Bytebuddy library at the same time on my Application
   - The order is 'Skywalking' first and then 'Another agent'
   - After 'TypePool$Resolution$NoSuchTypeException' is initially reported, the 'SW AGENT CACHE CLASS' is enabled, which greatly reduces the amount of errors reported, but some classes still report errors
   - What's more, but after executing the enhanced logic of 'skywalking', you cannot enter the logic of 'another agent', and the enhanced bytecode is as follows:
   ```java
          public TAsyncClient(TProtocolFactory protocolFactory, TAsyncClientManager manager, TNonblockingTransport transport) {
   /*33*/     this(protocolFactory, manager, transport, 0L);
          }
          public TAsyncClient(TProtocolFactory tProtocolFactory, TAsyncClientManager tAsyncClientManager, TNonblockingTransport tNonblockingTransport, long l) {
              TAsyncClient tAsyncClient = this;
              TProtocolFactory tProtocolFactory2 = tProtocolFactory;
              TAsyncClientManager tAsyncClientManager2 = tAsyncClientManager;
              TNonblockingTransport tNonblockingTransport2 = tNonblockingTransport;
              long l2 = l;
              tAsyncClient(tProtocolFactory2, tAsyncClientManager2, tNonblockingTransport2, l2, null);
              delegate$ggg83t1.intercept(tAsyncClient, new Object[]{tProtocolFactory2, tAsyncClientManager2, tNonblockingTransport2, l2});
              try {
                  TAsynClientAdvice.TAsyncServiceClientConstructInterceptor.onConstruct(this, new Object[]{tProtocolFactory, tAsyncClientManager, tNonblockingTransport, l});
              }
              catch (Throwable throwable) {}
          }
          /*
           * WARNING - void declaration
           */
          private /* synthetic */ TAsyncClient(TProtocolFactory tProtocolFactory, TAsyncClientManager tAsyncClientManager, TNonblockingTransport tNonblockingTransport, long l, auxiliary.WHuSnmrx wHuSnmrx) {
              void timeout;
              void transport;
              void manager;
              void protocolFactory;
   /*37*/     this.___protocolFactory = protocolFactory;
   /*38*/     this.___manager = manager;
   /*39*/     this.___transport = transport;
   /*40*/     this.___timeout = timeout;
          }
   ```
   
   ### Second Problem
   
   **The error information mentioned in the title is as follows:**
   ```java
    Execption: thirdparty.net.bytebuddy.pool.TypePool$Resolution$NoSuchTypeException: Cannot resolve type description for org.apache.thrift.TServiceClient$auxiliary$JnOx25xa
   	at thirdparty.net.bytebuddy.pool.TypePool$Resolution$Illegal.resolve(TypePool.java:162)
   	at thirdparty.net.bytebuddy.pool.TypePool$Default$WithLazyResolution$LazyTypeDescription.delegate(TypePool.java:1074)
   	at thirdparty.net.bytebuddy.description.type.TypeDescription$AbstractBase$OfSimpleType$WithDelegation.getModifiers(TypeDescription.java:8301)
   	at thirdparty.net.bytebuddy.description.ModifierReviewable$AbstractBase.matchesMask(ModifierReviewable.java:618)
   	at thirdparty.net.bytebuddy.description.ModifierReviewable$AbstractBase.isPublic(ModifierReviewable.java:336)
   	at thirdparty.net.bytebuddy.description.type.TypeDescription$AbstractBase.isVisibleTo(TypeDescription.java:7781)
   	at thirdparty.net.bytebuddy.matcher.VisibilityMatcher.matches(VisibilityMatcher.java:48)
   	at thirdparty.net.bytebuddy.matcher.VisibilityMatcher.matches(VisibilityMatcher.java:27)
   	at thirdparty.net.bytebuddy.matcher.NegatingMatcher.matches(NegatingMatcher.java:46)
   	at thirdparty.net.bytebuddy.matcher.ErasureMatcher.matches(ErasureMatcher.java:50)
   	at thirdparty.net.bytebuddy.matcher.ErasureMatcher.matches(ErasureMatcher.java:29)
   	at thirdparty.net.bytebuddy.matcher.MethodParameterTypeMatcher.matches(MethodParameterTypeMatcher.java:48)
   	at thirdparty.net.bytebuddy.matcher.MethodParameterTypeMatcher.matches(MethodParameterTypeMatcher.java:27)
   	at thirdparty.net.bytebuddy.matcher.CollectionItemMatcher.matches(CollectionItemMatcher.java:48)
   	at thirdparty.net.bytebuddy.matcher.CollectionItemMatcher.matches(CollectionItemMatcher.java:26)
   	at thirdparty.net.bytebuddy.matcher.NegatingMatcher.matches(NegatingMatcher.java:46)
   	at thirdparty.net.bytebuddy.matcher.MethodParametersMatcher.matches(MethodParametersMatcher.java:49)
   	at thirdparty.net.bytebuddy.matcher.MethodParametersMatcher.matches(MethodParametersMatcher.java:28)
   	at thirdparty.net.bytebuddy.matcher.ElementMatcher$Junction$Conjunction.matches(ElementMatcher.java:144)
   	at thirdparty.net.bytebuddy.matcher.FilterableList$AbstractBase.filter(FilterableList.java:125)
   	at thirdparty.net.bytebuddy.dynamic.scaffold.MethodRegistry$Default.prepare(MethodRegistry.java:506)
   	at thirdparty.net.bytebuddy.dynamic.scaffold.inline.RedefinitionDynamicTypeBuilder.make(RedefinitionDynamicTypeBuilder.java:204)
   	at thirdparty.net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.doTransform(AgentBuilder.java:11741)
   	at thirdparty.net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.transform(AgentBuilder.java:11677)
   	at thirdparty.net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.access$1700(AgentBuilder.java:11395)
   	at thirdparty.net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer$LegacyVmDispatcher.run(AgentBuilder.java:12069)
   	at thirdparty.net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer$LegacyVmDispatcher.run(AgentBuilder.java:12016)
   	at java.security.AccessController.doPrivileged(Native Method)
   	at thirdparty.net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.doPrivileged(AgentBuilder.java)
   	at thirdparty.net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.transform(AgentBuilder.java:11584)
   	at instrumentation.CodeBarrierTransformerDecorator$CodeBarrierResettableClassFileTransformer.transform(CodeBarrierTransformerDecorator.java:45)
   	at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
   	at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
   	at java.lang.ClassLoader.defineClass1(Native Method)
   	at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
   	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
   	at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
   	at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
   	at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
   	at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
   	at java.security.AccessController.doPrivileged(Native Method)
   	at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
   	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
   	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
   	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
   	at java.lang.ClassLoader.defineClass1(Native Method)
   	at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
   	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
   	at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
   	at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
   	at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
   	at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
   	at java.security.AccessController.doPrivileged(Native Method)
   	at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
   	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
   	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
   	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
   	at java.lang.Class.getDeclaredMethods0(Native Method)
   	at java.lang.Class.privateGetDeclaredMethods(Class.java:2729)
   	at java.lang.Class.getDeclaredMethods(Class.java:2003)
   	at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:489)
   	at org.springframework.util.ReflectionUtils.doWithLocalMethods(ReflectionUtils.java:367)
   	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.buildLifecycleMetadata(InitDestroyAnnotationBeanPostProcessor.java:207)
   	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.findLifecycleMetadata(InitDestroyAnnotationBeanPostProcessor.java:189)
   	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessMergedBeanDefinition(InitDestroyAnnotationBeanPostProcessor.java:128)
   	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessMergedBeanDefinition(CommonAnnotationBeanPostProcessor.java:298)
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyMergedBeanDefinitionPostProcessors(AbstractAutowireCapableBeanFactory.java:1077)
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:567)
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
   	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
   	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
   	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
   	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
   	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:277)
   	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1255)
   	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1175)
   	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:595)
   	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90)
   	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:376)
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1411)
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592)
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
   	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
   	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
   	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
   	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
   	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:847)
   	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877)
   	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
   	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
   	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744)
   	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391)
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:312)
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1204)
   	at com.yihua.thrift.ThriftClientApplication.main(ThriftClientApplication.java:10)
   ```
   
   ### What you expected to happen
   
   I hope to complete the enhancement and enable Another agent
   
   ### How to reproduce
   
   1. 开启Skywalking的SW_AGENT_CACHE_CLASS
   2. 使用`-javaagent:./skywaking.agent`先行随应用启动
   3. 再使用`Attach`启动使用ByteBuddy框架构建的agent,在该agent demo中,使用`@Advice.OnMethodExit`注解增强类`org.apache.thrift.async.TAsyncClient <init>`
   4. Thrift project 链接如下:https://github.com/luoyihua/thrift-project.git
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] wu-sheng closed issue #10526: [Bug] After open the {SW AGENT CACHE CLASS}, is still an error 【net. Bytebuddy. Pool. TypePool $$NoSuchTypeException Resolution: Cannot resolve type description for org.apache.thrift.TServiceClient$auxiliary$JnOx25xa】

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng closed issue #10526: [Bug] After open the {SW AGENT CACHE CLASS}, is still an error 【net. Bytebuddy. Pool. TypePool $$NoSuchTypeException Resolution: Cannot resolve type description for org.apache.thrift.TServiceClient$auxiliary$JnOx25xa】
URL: https://github.com/apache/skywalking/issues/10526


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org