[jboss-user] [JBoss AOP] - AOPC exception

ericn do-not-reply at jboss.com
Mon Jul 23 15:12:38 EDT 2007


Hi,

I am trying to upgrade our application from JBoss version 4.0.4 to run on JBoss version 4.2.1 which appears to use JBoss AOP 1.5.5.GA (which, by the way, doesn't show up on the JBoss AOP Downloads page.)  

One of our classes can no longer be aspectized by aopc.  I have managed to extract a small example class that demonstrates this problem (TestClass.java):


  | import java.util.List;
  | import java.util.Map;
  | 
  | public class TestClass
  | {
  |    List myList = null;
  |    Map myMap = null;
  | 
  |    public void function(Integer one, Integer two)
  |    {
  |       int index = 3;
  |       for (; index > 0; index--)
  |       {
  |          Integer key = (Integer) myList.get( index - 1);
  |          ((Double)myMap.get( key)).doubleValue();
  |       }
  |    }
  | }
  | 

And here is my  replication-aop.xml file:

  | <?xml version="1.0" encoding="UTF-8"?>
  | <aop>
  |   <prepare expr="field(* TestClass->myList)" />
  |   <prepare expr="field(* TestClass->myMap)" />
  | </aop>
  | 

when I run aopc like this:

  | aopc15.sh <path-to-test> -aoppath <path-to-test>/replication-aop.xml -aopclasspath <path-to-test> <path-to-test>/TestClass.class
  | 

I get this exception:
anonymous wrote : 
  | Exception in thread "main" java.lang.RuntimeException: failed to transform: TestClass
  |         at org.jboss.aop.instrument.Instrumentor.transform(Instrumentor.java:777)
  |         at org.jboss.aop.AspectManager.translate(AspectManager.java:909)
  |         at org.jboss.aop.AspectManager.transform(AspectManager.java:821)
  |         at org.jboss.aop.standalone.Compiler.compileFile(Compiler.java:345)
  |         at org.jboss.aop.standalone.Compiler.compile(Compiler.java:234)
  |         at org.jboss.aop.standalone.Compiler.main(Compiler.java:90)
  | Caused by: java.lang.ArrayIndexOutOfBoundsException: 7
  |         at javassist.bytecode.ByteArray.write16bit(ByteArray.java:40)
  |         at javassist.bytecode.StackMapTable$Shifter.update(StackMapTable.java:703)
  |         at javassist.bytecode.StackMapTable$Shifter.sameFrame(StackMapTable.java:679)
  |         at javassist.bytecode.StackMapTable$Walker.stackMapFrames(StackMapTable.java:191)
  |         at javassist.bytecode.StackMapTable$Walker.parse(StackMapTable.java:176)
  |         at javassist.bytecode.StackMapTable$Shifter.doit(StackMapTable.java:673)
  |         at javassist.bytecode.StackMapTable.shiftPc(StackMapTable.java:652)
  |         at javassist.bytecode.CodeIterator.insertGap0(CodeIterator.java:676)
  |         at javassist.bytecode.CodeIterator.insertGap(CodeIterator.java:636)
  |         at javassist.bytecode.CodeIterator.insertGapCore(CodeIterator.java:467)
  |         at javassist.bytecode.CodeIterator.insertGap(CodeIterator.java:413)
  |         at javassist.expr.Expr.replace0(Expr.java:285)
  |         at javassist.expr.FieldAccess.replace(FieldAccess.java:212)
  |         at org.jboss.aop.instrument.OptimizedFieldAccessTransformer$OptimizedFieldAccessExprEditor.replaceRead(OptimizedFieldAccessTransformer.java:321)
  |         at org.jboss.aop.instrument.FieldAccessTransformer$FieldAccessExprEditor.edit(FieldAccessTransformer.java:622)
  |         at javassist.expr.ExprEditor.loopBody(ExprEditor.java:188)
  |         at javassist.expr.ExprEditor.doit(ExprEditor.java:90)
  |         at javassist.CtClassType.instrument(CtClassType.java:1224)
  |         at org.jboss.aop.instrument.OptimizedFieldAccessTransformer.replaceFieldAccessInternally(OptimizedFieldAccessTransformer.java:293)
  |         at org.jboss.aop.instrument.OptimizedFieldAccessTransformer.doBuildFieldWrappers(OptimizedFieldAccessTransformer.java:99)
  |         at org.jboss.aop.instrument.FieldAccessTransformer.buildFieldWrappers(FieldAccessTransformer.java:100)
  |         at org.jboss.aop.instrument.Instrumentor.transform(Instrumentor.java:730)
  |         ... 5 more
  | 

I looks like this problem was introduced in JBoss AOP 1.5.4.GA.  In earlier versions this worked fine.  I am wondering if I am doing something wrong, or missing something, or if I should add this as a new bug in JIRA?

Thanks,
-Eric

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

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



More information about the jboss-user mailing list