3 Replies Latest reply on Sep 19, 2005 7:13 AM by Kabir Khan

    annotationc with bytecode-setting

    Michael Frieß Newbie

      Hi, I'm getting the following error when I execute the annotationc Ant task on my class files (with bytecode = true, jdk 1.4.2):

      [annotationc] java.lang.RuntimeException: failed to compile class: test.test.ConsoleClient
      [annotationc] at org.jboss.aop.annotation.compiler.ByteCodeAnnotationCompiler.compile(ByteCodeAnnotationCompiler.java:81)
      [annotationc] at org.jboss.aop.annotation.compiler.AnnotationCompiler.compile(AnnotationCompiler.java:46)
      [annotationc] at org.jboss.aop.annotation.compiler.AnnotationCompiler.main(AnnotationCompiler.java:23)
      [annotationc] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [annotationc] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      [annotationc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [annotationc] at java.lang.reflect.Method.invoke(Method.java:324)
      [annotationc] at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:208)
      [annotationc] at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:150)
      [annotationc] at org.apache.tools.ant.taskdefs.Java.run(Java.java:415)
      [annotationc] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:163)
      [annotationc] at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
      [annotationc] at org.jboss.aop.ant.AnnotationC.execute(AnnotationC.java:265)
      [annotationc] at org.apache.tools.ant.Task.perform(Task.java:317)
      [annotationc] at org.apache.tools.ant.Target.execute(Target.java:309)
      [annotationc] at org.apache.tools.ant.Target.performTasks(Target.java:334)
      [annotationc] at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
      [annotationc] at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
      [annotationc] at org.apache.tools.ant.Main.runBuild(Main.java:610)
      [annotationc] at org.apache.tools.ant.Main.start(Main.java:196)
      [annotationc] at org.apache.tools.ant.Main.main(Main.java:235)
      [annotationc] Caused by: javassist.NotFoundException: profile
      [annotationc] at javassist.ClassPool.get(ClassPool.java:302)
      [annotationc] at org.jboss.aop.annotation.compiler.AnnotationInfoCreator.createAnnotationInfo(AnnotationInfoCreator.java:156)
      [annotationc] at org.jboss.aop.annotation.compiler.ByteCodeAnnotationCompiler.compileMethod(ByteCodeAnnotationCompiler.java:232)
      [annotationc] at org.jboss.aop.annotation.compiler.ByteCodeAnnotationCompiler.compileClass(ByteCodeAnnotationCompiler.java:182)
      [annotationc] at org.jboss.aop.annotation.compiler.ByteCodeAnnotationCompiler.compile(ByteCodeAnnotationCompiler.java:77)
      [annotationc] ... 20 more
      


      jboss-aop.xml contains:

       <bind pointcut="all(@profile)">
       <interceptor class="test.aop.SimpleProfilingInterceptor"/>
       </bind>
      


      However, if I execute annotationc with the option "xml=true" (instead of bytecode=true) and force the generation of a metadata-aop.xml file, it works seamless.

      This works:

       <annotationc compilerclasspath="${archive.dependencies.classpath}"
       classpath="${archive.classes.dir}"
       xml="true"
       failOnError="true">
       <src path="${archive.src.dir}"/>
       <includesfile name="source.files"/>
       </annotationc>
      


      This doesnt:

       <annotationc compilerclasspath="${archive.dependencies.classpath}"
       classpath="${archive.classes.dir}"
       bytecode="true"
       failOnError="true">
       <src path="${archive.src.dir}"/>
       <includesfile name="source.files"/>
       </annotationc>
      



      I guess it's something simple? Any ideas?


      Thanks in advance,

      freezy