Hi,
I haven't solved my problem yet, but here there's a piece of code that (I 
think) generates the troble:

if(this.superclass!=null)        {
            this.superclass.defrost();
            agentClass.setSuperclass(this.superclass);
            System.err.println("Superclass: "+agentClass.getSuperclass());
}

byte code[] = agentClass.toBytecode();
return this.defineClass(agentName,code,0,code.length);


being both superclass and agentClass a CtClass reference (obtained thru the 
class pool). Now, the superclass of my agentClass must be com.ibm.aglet.Aglet, 
and the output of the program shows:

Superclasse rilevata: [EMAIL PROTECTED] abstract class com.ibm.aglet.Aglet 
implements java.io.Serializable, .....]

thus it seems ok. But, if after the define class I perform a newInstance on the 
class object, and then a cast to the Aglet class:

Aglet a = (Aglet) myAgentClass.newInstance();

I get a ClassCastException. In other words, it seems as the setSuperclass 
method is not working well. Any idea?

Luca


P.S.
the same code with an older version of javassist, 2.0, worked.


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3899858#3899858

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3899858


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to