Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Virtual Machine / September 2004

Tip: Looking for answers? Try searching our database.

java.lang.VerifyError

Thread view: 
rags - 06 Sep 2004 18:01 GMT
How to avoid Verify error

Exception in thread "main" java.lang.VerifyError: (class: rags_hello,
method: i signature: (II)V) Expecting to find object/array on stack

I am using BCEL to intrument byte code
and JDK-5

I am using these intruction to instrument
 code.append(InstructionConstants.DUP);
 code.append(InstructionConstants.DUP);
 code.append(new PUSH(cp,mesg));                  
 code.append(new INVOKESTATIC(prb));

Decomiling the code using JAD and then recompiling the instrumented code
works.
Chris Uppal - 07 Sep 2004 10:38 GMT
> I am using these intruction to instrument
>   code.append(InstructionConstants.DUP);
>   code.append(InstructionConstants.DUP);
>   code.append(new PUSH(cp,mesg));
>   code.append(new INVOKESTATIC(prb));

I don't know BCEL, but this looks as if it's emitting code to do two "dups",
followed by a "push" of something that doesn't look much like an integer to me,
followed by an "invokestatic".  If the error message is correct then the static
method expects to find two ints on the stack.

If that doesn't give you any ideas, then you could try using the verifier in
BCEL.  I'm told that it gives more helpful error messages than the "real" one.

> Decomiling the code using JAD and then recompiling the instrumented code
> works.

So compare the bytecode you generate with that produced by JAD+recompile, and
see what the differences are.  That should point you directly at the problem if
you can narrow down your test case enough.

   -- chris
rags - 08 Sep 2004 10:27 GMT
thanx chris
BCEL really gives more information than java.lang.verifier

Here is the code i wrote to verify

JavaClass       java_class1 = new ClassParser(argv[i]).parse();
Verifier v;
     v=VerifierFactory.getVerifier(java_class1.getClassName());
     System.out.println(v.doPass1());
     System.out.println(v.doPass2());
      System.out.println(v.doPass3a(2));
     System.out.println(v.doPass3b(2));


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.