Repository navigation
Replies: 1 comment
|
I think you are better to ask at byte-buddy project. We are not expert about mixing using 2 kinds of class manipulating tech. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
When I use the instrumentation.redefinitecclasses method in my application. I have java.lang.unsupported operationexception: class redefinition failed: attempted to change superclass or interfaces as follows:
java.lang.UnsupportedOperationException: class redefinition failed: attempted to change superclass or interfaces at sun.instrument.InstrumentationImpl.redefineClasses0(Native Method) at sun.instrument.InstrumentationImpl.redefineClasses(InstrumentationImpl.java:170) at org.hzero.boot.api.customize.agent.HotSwapClient.redefine(HotSwapClient.java:64) at org.hzero.boot.api.customize.agent.HotSwapClient.redefine(HotSwapClient.java:52) at org.hzero.boot.api.customize.service.impl.DefaultApiCustomizeService.customizeApi(DefaultApiCustomizeService.java:94) at org.hzero.boot.api.customize.service.ApiCustomizeService.customizeApi(ApiCustomizeService.java:68) at org.hzero.boot.api.customize.controller.CustomizeController.apiCustomize$original$7WLQLQ1Z(CustomizeController.java:48) at org.hzero.boot.api.customize.controller.CustomizeController.apiCustomize$original$7WLQLQ1Z$accessor$qUYyW8qw(CustomizeController.java) at org.hzero.boot.api.customize.controller.CustomizeController$auxiliary$kVlvzvYS.call(Unknown Source) at org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstMethodsInter.intercept(InstMethodsInter.java:86) at org.hzero.boot.api.customize.controller.CustomizeController.apiCustomize(CustomizeController.java) 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.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:197) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:141) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:106) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:894) atThe root cause is that when the class object is obtained through classpool. Get targetclassname of javassist technology, the class object happens to be enhanced by skywalking agent. Through configuration “agent.is_ open_ debugging_ class = true”, the debugging folder generated in the skywalking agent directory. Through comparison, it is found that this class inherits the enhancedinstance interface and an object type interface $ EnhancedClassField ws field, and these changes cannot be obtained when classpool.get (targetclassname) obtains the class object.
The restriction on redefinition of instrumentation.redefine class is queried. The requirements are as follows:
All reactions