Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在 instrument-lib/ 里,需要支持define 工具类 #26

Open
hengyunabc opened this issue Aug 27, 2021 · 2 comments
Open

在 instrument-lib/ 里,需要支持define 工具类 #26

hengyunabc opened this issue Aug 27, 2021 · 2 comments

Comments

@hengyunabc
Copy link
Collaborator

比如在增强 dubbo里,可能会有一些工具类,处理数据之后,才能传送到后续处理函数里。那么这些工具类需要在运行时动态 define 到应用的 ClassLoader 里。

@hengyunabc
Copy link
Collaborator Author

目前会有重复define现象,需要解决,只define一次。 当instrument=里配置了多个类时。

Caused by: java.lang.LinkageError: loader (instance of  sun/misc/Launcher$AppClassLoader): attempted  duplicate class definition for name: "org/apache/http/impl/client/MyTextMapSetter"
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
        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 com.alibaba.bytekit.utils.ReflectUtils.defineClass(ReflectUtils.java:462)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@hengyunabc and others