Java Instrumentation for URI class: Adding a dependency throws ClassNotFoundException

Viewed 60

I have instrumented an URI Constructor to write the created URI to a logshipper. The Logshipper class is part of my Agent Library which is both a maven dependency and a runtime Arg.

The Instrumentation inside the Agent uses a ClassFileTransformer to add the line of code to that constructor. However, when the constructor is called, it throws a ClassNotFoundException with detailMessage: edu/overbeck/masterarbeit/agent/LogShipper. When I take a look in the ClassLoader, the Class is however loaded. A screenshot of my IntelliJ debugger: ![Weird err][1]

Why does this happen? My other instrumented class, ContentLengthOutputStream from the Apache HTTP-core library, works fine with the LogShipper. [1]: https://i.stack.imgur.com/vf8b4.png

1 Answers
Related