You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2020/06/02 08:44:47 UTC

[GitHub] [skywalking] liuhaoXD commented on issue #4852: Does skywalking agent support Intercepting JDK built-in classes?

liuhaoXD commented on issue #4852:
URL: https://github.com/apache/skywalking/issues/4852#issuecomment-637389595


   I tried to intercept the  `java.util.concurrent.ThreadPoolExecutor` class and got an exception:
   
   ```
   ERROR 2020-06-02 15:13:36:543 main SkyWalkingAgent : Enhance class java.util.concurrent.ThreadPoolExecutor error. 
   java.lang.IllegalStateException: Cannot inject auxiliary class into bootstrap loader using reflection
           at org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$InjectionStrategy$UsingReflection.resolve(AgentBuilder.java:3383)
           at org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$InitializationStrategy$SelfInjection$Split$Dispatcher.register(AgentBuilder.java:3195)
           at org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$Default$Transformation$Simple$Resolution.apply(AgentBuilder.java:10124)
           at org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.doTransform(AgentBuilder.java:10494)
           at org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.transform(AgentBuilder.java:10457)
           at org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.access$1500(AgentBuilder.java:10223)
           at org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer$LegacyVmDispatcher.run(AgentBuilder.java:10833)
           at org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer$LegacyVmDispatcher.run(AgentBuilder.java:10780)
           at java.security.AccessController.doPrivileged(Native Method)
           at org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.transform(AgentBuilder.java:10380)
           at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
           at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
           at sun.instrument.InstrumentationImpl.retransformClasses0(Native Method)
           at sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:498)
           at org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$RedefinitionStrategy$Dispatcher$ForJava6CapableVm.retransformClasses(AgentBuilder.java:6865)
           at org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$RedefinitionStrategy$Collector$ForRetransformation.doApply(AgentBuilder.java:7142)
           at org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$RedefinitionStrategy$Collector.apply(AgentBuilder.java:6991)
           at org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$RedefinitionStrategy.apply(AgentBuilder.java:4858)
           at org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$Default.installOn(AgentBuilder.java:9350)
           at org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$Default.installOn(AgentBuilder.java:9320)
           at org.apache.skywalking.apm.agent.SkyWalkingAgent.premain(SkyWalkingAgent.java:124)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:498)
           at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
           at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)
   ```


----------------------------------------------------------------
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.

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