|
-
May 3rd, 2015, 02:04 PM
#1
Getting “java.lang.NoClassDefFoundError” on running with javaagent- BCEL
I am trying to instrument a jar file (main.jar) with javaagent.jar using BCEL. basically where ever I find any aload in bytecode, I m trying to insert a function call to a static function called Fun() in class "someclass" using
if (opcode instanceof aload) {
iFactory.createInvoke("someclass", "fun", Type.VOID, new Type[]{}, Constants.INVOKESTATIC);
my "someclass" class reside in javaagent.jar
on executing
java -javaagent:javaagent.jar -jar main.jar
or
java -javaagent:javaagent.jar -jar main.jar javaagent.jar
or (I created a separate jar for my "someclass" called someclasscontained.jar)
java -cp someclasscontained.jar -javaagent:javaagent.jar -jar main.jar
I am getting
Exception in thread "main" java.lang.NoClassDefFoundError: someclass
error. i tried with -bootclasspath/p option but still not working. does anyone has any clue?
(1) all jar resides in same folder 2)checked all silly mistakes 3) used full qualified classname
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|