Re: [aspectwerkz-user] Custom annotation is not wrapped in AnnotationInfo
Alexandre Vasseur <[email protected]>
| Newsgroups | gmane.comp.java.aspectwerkz.user |
|---|---|
| Message-ID | <[email protected]> |
Ok we don't see the annotation there.
Can you try with this syntax:
(no parenthesis and double quote)
/**
* @Around call(* com.example.util.logging.Logger.info(..))
*/
Alex
On 4/22/05, Kenji Nakamura <[email protected]> wrote:
> Alex,
>
> Verbose flag was specified in the ant task.
> I also ran from command line just in case, and got the same output
>
> kenjin@omega: java org.codehaus.aspectwerkz.annotation.AnnotationC
> -verbose -src src/java/main -classes target/classes -dest /tmp/test
> AnnotationC::INFO - parsing source dirs:
> AnnotationC::INFO - src/java/main
> AnnotationC::INFO - compiling annotations...
> AnnotationC::INFO - note: if no output is seen, then nothing is compiled
> AnnotationC::INFO - class [com.example.deliver.ProgressBarLoggingAspect]
> AnnotationC::INFO - class [com.example.token.InstanceLogFilterAspect]
> AnnotationC::INFO - compiled classes written to
> /tmp/testAnnotationC::INFO - compilation successful
>
> I'm interested in the solution with backport 175. It would be great if
> you show me how to use it.
>
> Thanks,
>
> -kenji
>
> On Apr 22, 2005, at 1:09 AM, Alexandre Vasseur wrote:
>
> > Can you try to use the "-verbose " flag during the AnnotationC phase.
> >
> > If you can, I would advise to use http://backport175.codehaus.org to
> > compile the annotation to regular Java 5 binary format. The next
> > version of AspectWerkz will precisely use our backport project instead
> > of the AnnotationC things.
> > Let me know and I'll send a short how-to.
> >
> >
> > Alex
> >
> > On 4/21/05, Kenji Nakamura <[email protected]> wrote:
> >> Hi,
> >>
> >> I'm working on integrating AspectWerkz2.0 into jboss 3.2.6 and Apple
> >> JDK1.4.2 with prepared-classpath weaving.
> >> I could use aspects with XML definition, but have problem with
> >> annotations.
> >> The source was processed with AnnotationC ant task (via maven.xml).
> >> How should I interpret the error message?
> >>
> >> Thanks in advance,
> >>
> >> AnnotationC maven.xml
> >> <goal name="build:aw2annotationc"
> >> description="Run aspectwerkz 2 annotation compiler" >
> >> <ant:taskdef name="annotationc"
> >>
> >> classname="org.codehaus.aspectwerkz.annotation.AnnotationCTask"
> >> classpathref="maven.dependency.classpath" />
> >> <ant:annotationc verbose="true"
> >>
> >> properties="${basedir}/src/resources/main/annotation.properties"
> >> destdir="${basedir}/target/classes"
> >> copytodest="**/*.class">
> >> <ant:src path="${basedir}/src/java/main" />
> >> <ant:classpath path="${basedir}/target/classes" />
> >> </ant:annotationc>
> >> </goal>
> >>
> >> AnnotationC output
> >> AnnotationC::INFO - parsing source dirs:
> >> AnnotationC::INFO -
> >> /Users/user/repository/modules/aspect/src/java/main
> >> AnnotationC::INFO - compiling annotations...
> >> AnnotationC::INFO - note: if no output is seen, then nothing is
> >> compiled
> >> AnnotationC::INFO - class
> >> [com.example.deliver.ProgressBarLoggingAspect]
> >> AnnotationC::INFO - class [com.example.token.InstanceLogFilterAspect]
> >> AnnotationC::INFO - compiled classes written to
> >> /Users/user/repository/modules/aspect/target/classes
> >> AnnotationC::INFO - compilation successful
> >>
> >> StackTrace
> >> java.lang.RuntimeException: Custom annotation is not wrapped in
> >> AnnotationInfo: org.codehaus.aspectwerkz.annotation.AnnotationInfo
> >> [sun.misc.Launcher$AppClassLoader@53ba3d /
> >> org.codehaus.classworlds.RealmClassLoader@b3b6a6 /
> >> org.jboss.mx.loading.UnifiedClassLoader3@502283{
> >> url=file:/Users/user/jboss/server/foobar/tmp/deploy/tmp6798jboss-
> >> service.xml ,addedOrder=2}
> >> at
> >> org.codehaus.aspectwerkz.annotation.instrumentation.asm.CustomAttribut
> >> eH
> >> elper.extractCustomAnnotation(CustomAttributeHelper.java:59)
> >> at
> >> org.codehaus.aspectwerkz.annotation.instrumentation.asm.CustomAttribut
> >> eH
> >> elper.extractCustomAnnotation(CustomAttributeHelper.java:43)
> >> at
> >> org.codehaus.aspectwerkz.annotation.instrumentation.asm.AsmAnnotationH
> >> el
> >> per.extractAnnotations(AsmAnnotationHelper.java:271)
> >> at
> >> org.codehaus.aspectwerkz.annotation.instrumentation.asm.AsmAnnotationH
> >> el
> >> per$MethodAnnotationExtractor.visitMethod(AsmAnnotationHelper.java:
> >> 126)
> >> at
> >> org.codehaus.aspectwerkz.org.objectweb.asm.ClassReader.accept(Unknown
> >> Source)
> >> at
> >> org.codehaus.aspectwerkz.reflect.impl.asm.AsmMethodInfo.getAnnotations
> >> (A
> >> smMethodInfo.java:213)
> >> at
> >> org.codehaus.aspectwerkz.annotation.instrumentation.asm.AsmAnnotations
> >> .g
> >> etAnnotations(AsmAnnotations.java:127)
> >> at
> >> org.codehaus.aspectwerkz.annotation.AspectAnnotationParser.parsePointc
> >> ut
> >> Attributes(AspectAnnotationParser.java:210)
> >> at
> >> org.codehaus.aspectwerkz.annotation.AspectAnnotationParser.parseMethod
> >> At
> >> tributes(AspectAnnotationParser.java:182)
> >> at
> >> org.codehaus.aspectwerkz.annotation.AspectAnnotationParser.doParse(Asp
> >> ec
> >> tAnnotationParser.java:100)
> >> at
> >> org.codehaus.aspectwerkz.annotation.AspectAnnotationParser.parse(Aspec
> >> tA
> >> nnotationParser.java:57)
> >> at
> >> org.codehaus.aspectwerkz.definition.DocumentParser.parseAspectElements
> >> (D
> >> ocumentParser.java:433)
> >> at
> >> org.codehaus.aspectwerkz.definition.DocumentParser.parsePackageElement
> >> s(
> >> DocumentParser.java:353)
> >> at
> >> org.codehaus.aspectwerkz.definition.DocumentParser.parseSystemElement(
> >> Do
> >> cumentParser.java:238)
> >> at
> >> org.codehaus.aspectwerkz.definition.DocumentParser.parseSystemElements
> >> (D
> >> ocumentParser.java:181)
> >> at
> >> org.codehaus.aspectwerkz.definition.DocumentParser.parse(DocumentParse
> >> r.
> >> java:168)
> >> at
> >> org.codehaus.aspectwerkz.definition.XmlParser.parseNoCache(XmlParser.j
> >> av
> >> a:178)
> >> at
> >> org.codehaus.aspectwerkz.definition.SystemDefinitionContainer.register
> >> Cl
> >> assLoader(SystemDefinitionContainer.java:139)
> >> at
> >> org.codehaus.aspectwerkz.definition.SystemDefinitionContainer.getHiera
> >> rc
> >> hicalDefinitionsFor(SystemDefinitionContainer.java:317)
> >> at
> >> org.codehaus.aspectwerkz.definition.SystemDefinitionContainer.getDefin
> >> it
> >> ionsFor(SystemDefinitionContainer.java:225)
> >> at
> >> org.codehaus.aspectwerkz.transform.inlining.ContextImpl.<init>(Context
> >> Im
> >> pl.java:99)
> >> at
> >> org.codehaus.aspectwerkz.transform.inlining.InliningWeavingStrategy.ne
> >> wC
> >> ontext(InliningWeavingStrategy.java:259)
> >> at
> >> org.codehaus.aspectwerkz.transform.AspectWerkzPreProcessor._preProcess
> >> (A
> >> spectWerkzPreProcessor.java:166)
> >> at
> >> org.codehaus.aspectwerkz.transform.AspectWerkzPreProcessor.preProcess(
> >> As
> >> pectWerkzPreProcessor.java:148)
> >> at
> >> org.codehaus.aspectwerkz.hook.impl.ClassPreProcessorHelper.defineClass
> >> 0P
> >> re(ClassPreProcessorHelper.java:107)
> >> at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
> >> at
> >> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:
> >> 123)
> >> at
> >> java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
> >> at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
> >> at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
> >> at java.security.AccessController.doPrivileged(Native Method)
> >> at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
> >> at
> >> org.jboss.mx.loading.UnifiedClassLoader.findClass(UnifiedClassLoader.j
> >> av
> >> a:520)
> >> at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
> >>
> >> Here is the aop.xml.
> >> <aspectwerkz>
> >> <system id="app">
> >> <package name="com.example.token">
> >> <aspect class="InstanceLogFilterAspect"></aspect>
> >> </package>
> >> </system>
> >> </aspectwerkz>
> >>
> >> This is the source with annotation.
> >>
> >> /**
> >> * @Around("call(* com.example.util.logging.Logger.info(..))")
> >> */
> >> public Object dynamicFilterLog(JoinPoint sjp) throws Throwable {
> >> log.info("=========== Intercepted by InstanceLogFilterAspect.
> >> ============== ");
> >>
> >> return sjp.proceed();
> >> }
> >>
> >>
> >
> >
>
>