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:38:14 UTC

[GitHub] [skywalking] liuhaoXD opened a new issue #4852: Does skywalking agent support Intercepting JDK built-in classes?

liuhaoXD opened a new issue #4852:
URL: https://github.com/apache/skywalking/issues/4852


   
   - Why do you submit this issue?
   - [*] Question or discussion
   - [ ] Bug
   - [ ] Requirement
   - [ ] Feature or performance improvement
   
   ___
   ### Question
   
   Hi, dear developers.
   
   I'm trying to explore more abilities of skywalking agent. Does it support Intercepting the built-in classes like `java.util.HashMap#containsKey` or `java.util.concurrent.ThreadPoolExecutor#getCorePoolSize`?


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



[GitHub] [skywalking] wu-sheng closed issue #4852: Does skywalking agent support Intercepting JDK built-in classes?

Posted by GitBox <gi...@apache.org>.
wu-sheng closed issue #4852:
URL: https://github.com/apache/skywalking/issues/4852


   


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



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

Posted by GitBox <gi...@apache.org>.
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



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

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #4852:
URL: https://github.com/apache/skywalking/issues/4852#issuecomment-637391501


   This is not about skywalking, this is about the codes. Please think the logic, if your agent is using the classes, how could you enhance them? Your example is this case.
   
   For your question, yes, we can. Check the bootstrap plugin, we are enhancing some of the JDK rt.jar classes.


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