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 &lt;[email protected]&gt; 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 &lt;[email protected]&gt; 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" &lt;[email protected]&gt;
 To: &lt;[email protected]&gt;
 Sent: Wednesday, October 13, 2010 4:58 AM
 Subject: [asm] Re: byte code transformation checking
 

&gt; 
&gt;  First of all, ASM isn't designed to work with broken bytecode 
&gt; structures. In other words, the bytecode must be readable and I suspect 
&gt; you may have an incompletely saved file.
&gt; 
&gt;  But if you are certain that file is intact, in this case it haven't 
&gt; got to the CheckClassAdapter, because of the broken bytecode structures. 
&gt; To deal with that you need to put the CheckClassAdapter into your 
&gt; visitors chain before the ClassWriter and make sure it passes trough.
&gt; 
&gt;  regards,
&gt;  Eugene
&gt; 
&gt; 
&gt; luc peuvrier at home wrote:
&gt;&gt; Hi,
&gt;&gt;  
&gt;&gt; I run CheckClassAdapter main with 
&gt;&gt; "logs/classes/org/eclipse/jdt/internal/junit/runner/RemoteTestRunner.class" 
&gt;&gt; as argument.
&gt;&gt; And I have the here below error:
&gt;&gt;  
&gt;&gt;
&gt;&gt;     Exception in thread "main"
&gt;&gt;     _java.lang.ArrayIndexOutOfBoundsException_: 2
&gt;&gt;     at
&gt;&gt;     net.sf.joafip.asm.ClassReader.readFrameType(_ClassReader.java:1699_)
&gt;&gt;     at net.sf.joafip.asm.ClassReader.accept(_ClassReader.java:1237_)
&gt;&gt;     at net.sf.joafip.asm.ClassReader.accept(_ClassReader.java:436_)
&gt;&gt;     at
&gt;&gt;     net.sf.joafip.asm.util.CheckClassAdapter.verify(_CheckClassAdapter.java:207_)
&gt;&gt;     at
&gt;&gt;     net.sf.joafip.asm.util.CheckClassAdapter.verify(_CheckClassAdapter.java:253_)
&gt;&gt;     at
&gt;&gt;     net.sf.joafip.asm.util.CheckClassAdapter.main(_CheckClassAdapter.java:185_)
&gt;&gt;
&gt;&gt;  
&gt;&gt; I expect CheckClassAdapter say to me that is wrong in RemoteTestRunner 
&gt;&gt; class.
&gt;&gt;  
&gt;&gt; Best regards
&gt;&gt; Luc
&gt; 
&gt; 
  
&gt; 
&gt; -- 
&gt; You receive this message as a subscriber of the [email protected] mailing list.
&gt; To unsubscribe: mailto:[email protected]
&gt; For general help: mailto:[email protected]?subject=help
&gt; OW2 mailing lists service home page: http://www.ow2.org/wws
&gt;
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.