Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] after throwing problem

Ive had the same problem, and my solution was to implement that particular aspect using the language extensions instead of annotations. If you raise this as a bug, please post it back to the list so that I can watch it, too.

Ashley Williams wrote:

Hi,

Having converted my aspects to use the @AspectJ style, I'm now getting a strange error message when a compile my tracing aspect,.
First here is the section of code:


        @Pointcut("execution(@Tracing * *(..)) && @annotation(tracing)")
        void annotatedMethods(Tracing tracing) {
        }
@AfterThrowing(pointcut = "annotatedMethods(tracing)", throwing = "t")
        public void logException(JoinPoint thisJoinPoint, Tracing tracing,
                        Throwable t) {
                Level level = Level.toLevel(tracing.level());
                if (logger.isEnabledFor(level)) {
logger.log(level, formatter.formatSignatureThrowing(thisJoinPoint),
                                        t);
                }
        }

So I am matching on all methods annotated with @Tracing and logging the subclass of Throwable that may have been thrown.
However when I run my test case i get the following error:

java.lang.VerifyError: (class: com/db/abfo/tracing/PojoOne, method: calculate signature: ()V) catch_type not a subclass of Throwable

This used to work when I used the aspectj after throwing language extention form:


pointcut annotatedMethods(Tracing tracing) : execution(@Tracing * *(..)) && @annotation(tracing);

after(Tracing tracing) throwing(Throwable t) : annotatedMethods(tracing) {
                Level level = tracing.level().getLevel();
                if (logger.isEnabledFor(level)) {
logger.log(level, formatter.formatSignatureThrowing(thisJoinPoint),
                                        t);
                }
        }

Any ideas?
- Ashley
---

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional EU corporate and regulatory disclosures.


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

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users

--
Chris Rose
Developer    Planet Consulting Group
(780) 577-8433
crose@xxxxxxxxxxxx


Back to the top