Getting error on instrumentation
java.lang.RuntimeException: java.lang.ClassNotFoundException: Deposit
at org.objectweb.asm.ClassWriter.getCommonSuperClass(U
This error is occurring because ASM is generating stack map frames, and for some bytecodes, the stack map frames must contain the common superclass of two classes. By default, ASM implements this by loading classes via Class.forName and then implements the proper algorithm using reflection. Presumably, the ASM library is unable to load your Deposit class from its class loader.
To avoid the error, you'll need to either use SKIP_FRAMES (note: version 51.0 of class file used by Java 7 requires stack map frames, so this is a non-option if you're generating Java 7 bytecode), or you need to subclass ClassWriter and override getCommonSuperClass. Depending on what your code is doing, perhaps you can hard-code the answers using string comparisons, or perhaps you can take the ASM implementation and rewrite it to use a ClassLoader that you specify.