[jboss-user] [Javassist] New message: "Re: javassist.bytecode.BadBytecode: unset variable. Please Help Me!"

jaikiran pai do-not-reply at jboss.com
Tue Feb 23 03:15:06 EST 2010


User development,

A new message was posted in the thread "javassist.bytecode.BadBytecode: unset variable. Please Help Me!":

http://community.jboss.org/message/527799#527799

Author  : jaikiran pai
Profile : http://community.jboss.org/people/jaikiran

Message:
--------------------------------------------------------------
> megalodon wrote:
>  
> Some more information regarding this error:
>  
> 1. In prefix method, I am creating a new instance and assigning it to localMIName variable. Later I am just printing the newly created object (with over ridden toString() method). So there are 2 statements here. One to assign new instance to localMIName and another to print localMIName value. *IF, these 2 statements are submitted to CtMethod.insertBefore() function as a single block, I get no exception!* Mind you, If I add a statement later on to print localMIName in a separate statement (another CtMethod.insertBefore()) call, I still get the exception! What happens to the assigned value? Does it go out of scope?? Why does this happen only in JSP classes?
>  
> 
> 
 
 
I haven't looked much into the details and can't help much as to what's wrong with your code. But looking at some of your posts here, you seem to be having a hard time trying to debug these javassist runtime issues. Sometime back, there was thread in this forum where a user pointed to a open source library which he had developed as an wrapper to Javassist http://www.fuin.org/srcgen4javassist/index.html . In one of his examples http://www.fuin.org/srcgen4javassist/examples.html he shows how it can be used to generate this debug information from javassist. I haven't personally given it a try, but maybe you might find it useful. You could use that library to wrap to javassist code and print out debug information - thay way you can see the exact code that has been generated.

--------------------------------------------------------------

To reply to this message visit the message page: http://community.jboss.org/message/527799#527799




More information about the jboss-user mailing list