Re: Re: Re: byte code transformation checking
Rajaraman Santhanam <[email protected]>
| Newsgroups | gmane.comp.java.objectweb.asm |
|---|---|
| Message-ID | <12ba4a03234.9136742146219630677.-2187072106871086367@zohocorp.com> |
When I try CheckClassAdaptor, the verify method returns an error with "ClassNotFoundException" in the target bytecode. I get these exception only in the classes I transform. the trace here - http://www.pasteme.org/e1b37225f568d1103da4ef84615b4726 Any clue here? regards, ramanr ---- On Wed, 13 Oct 2010 13:23:58 +0530 Rajaraman Santhanam <[email protected]> wrote ---- When I try CheckClassAdaptor, the verify method returns an error with "ClassNotFoundException" in the target bytecode. I get these exception only in the classes I transform. the trace here - http://www.pasteme.org/e1b37225f568d1103da4ef84615b4726 Any clue here? regards, ramanr ---- On Wed, 13 Oct 2010 12:44:12 +0530 luc peuvrier at home <[email protected]> wrote ---- I integrated CheckClassAdapter in my bytecode transformer as preconized in CheckClassAdapter javadoc class header. The "CheckClassAdapter.verify(new ClassReader(code), false, pw);" invokation gives: java.lang.ArrayIndexOutOfBoundsException : 65 at net.sf.joafip.asm.ClassReader.readLabel(ClassReader.java:1744) at net.sf.joafip.asm.ClassReader.readFrameType(ClassReader.java:1724) at net.sf.joafip.asm.ClassReader.accept(ClassReader.java:1237) at net.sf.joafip.asm.ClassReader.accept(ClassReader.java:436) at net.sf.joafip.asm.util.CheckClassAdapter.verify(CheckClassAdapter.java:207) at net.sf.joafip.asm.util.CheckClassAdapter.verify(CheckClassAdapter.java:253) at net.sf.joafip.store.service.bytecode.agent.PersistableCodeGenerator.generate(PersistableCodeGenerator.java:216) at net.sf.joafip.store.service.bytecode.agent.PersistableTransformer.transform(PersistableTransformer.java:89) at net.sf.joafip.store.service.bytecode.agent.MainTransformerTest.run(MainTransformerTest.java:77) at net.sf.joafip.store.service.bytecode.agent.MainTransformerTest.main(MainTransformerTest.java:49) That is the same error when check the class reading bytecode in file. The file is not corrupted. I dicovered that I must set the class writer option flag with "ClassWriter.COMPUTE_FRAMES" because I add surronding try {} finally{} to the mehods code. Unfortunately, the class reader does not explicity complains about a frame structure error. Regards Luc ----- Original Message ----- From: "Eugene Kuleshov" <[email protected]> To: <[email protected]> Sent: Wednesday, October 13, 2010 4:58 AM Subject: [asm] Re: byte code transformation checking > > First of all, ASM isn't designed to work with broken bytecode > structures. In other words, the bytecode must be readable and I suspect > you may have an incompletely saved file. > > But if you are certain that file is intact, in this case it haven't > got to the CheckClassAdapter, because of the broken bytecode structures. > To deal with that you need to put the CheckClassAdapter into your > visitors chain before the ClassWriter and make sure it passes trough. > > regards, > Eugene > > > luc peuvrier at home wrote: >> Hi, >> >> I run CheckClassAdapter main with >> "logs/classes/org/eclipse/jdt/internal/junit/runner/RemoteTestRunner.class" >> as argument. >> And I have the here below error: >> >> >> Exception in thread "main" >> _java.lang.ArrayIndexOutOfBoundsException_: 2 >> at >> net.sf.joafip.asm.ClassReader.readFrameType(_ClassReader.java:1699_) >> at net.sf.joafip.asm.ClassReader.accept(_ClassReader.java:1237_) >> at net.sf.joafip.asm.ClassReader.accept(_ClassReader.java:436_) >> at >> net.sf.joafip.asm.util.CheckClassAdapter.verify(_CheckClassAdapter.java:207_) >> at >> net.sf.joafip.asm.util.CheckClassAdapter.verify(_CheckClassAdapter.java:253_) >> at >> net.sf.joafip.asm.util.CheckClassAdapter.main(_CheckClassAdapter.java:185_) >> >> >> I expect CheckClassAdapter say to me that is wrong in RemoteTestRunner >> class. >> >> Best regards >> Luc > > > > -- > You receive this message as a subscriber of the [email protected] mailing list. > To unsubscribe: mailto:[email protected] > For general help: mailto:[email protected]?subject=help > OW2 mailing lists service home page: http://www.ow2.org/wws >
message-footer.txt
(text/plain, 238 B)
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws