Skip to content

Injecting helper classes into parent classloader #1888

@rupinder10

Description

@rupinder10

I have a URLClassloader that runs the code in the class I am trying to instrument. The instrumented code uses reflection to call methods in another classloader that is one of the descendent in the class loader hierarchy, lets call it X. It works fine for me. But I would like to cache these into another class called CachedMethods and then call the instrumentation and have the instrumented code do CacheMethods.get("myMethod").invoke(). But I get a ClassNotFoundException at runtime. How do I load the cache in the classloader X and then make it available in the upstream URL Classloader ?

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions