You need to register the @Aspect class as a bean in the context.
Type: Posts; User: plethora; Keyword(s):
You need to register the @Aspect class as a bean in the context.
Why not simply use a custom implementation of the Pointcut interface?
If i understand you correctly, you could use a HandlerExceptionResolver for this purpose. See Chapter 13 in the manual.
Spring AOP does not intercept such 'internal' calls. The reference manual contains a detailed explanation for this in chapter 6.
There are various possible solutions for this problem.
Can you provide a minimal example (just using a static main() to load a context and call a bean) that demonstrates the problem?
Not to sound unhelpful, but could you try to make the example as minimal as possible?
If you think it's a Spring AOP problem, removing annotation-driven IoC etc might be a good idea. What version...
This might seem an easy answer, but could you try switching spring to version 2.0.7?
A number of generics related AOP issues have been fixed in that release.
I think this existing JIRA request is about the same thing: http://opensource.atlassian.com/projects/spring/browse/SPR-3723
Could you provide a link to the part of the documentation that states this?
As for the difference between @Aspect and Schema styles: it seems that Schema style requires a first parameter of type...
1) 'fooName' only applies to the parameter of the intercepted method. "args(name, age)" refers to the advice method only, meaning SimpleProfiler#profile().
2) Should "argNames" (in annotation...
What version of spring are you using?
You can use regular Spring IoC to inject a LoggingService into your aspect bean.
How are you instantiating the spring context? A common mistake is to use of the BeanFactory implementations instead of a full-fledged ApplicationContext.
No problem. Making mistakes is human :)
Can you provide a minimal testcase? It would help if you replaced the <tx:advice> with some custom advice (class implementing MethodInterceptor for example).
Hmm, actually it looks like it *is* possible to use 'sort-of parameterized' pointcuts in XML style - contrary to what the manual says.
I'm not sure why you're seeing multiple calls to your advice...
One obvious trick would be using bootclasspath to load a patched java.lang.ClassLoader. That has saved my day serveral times.
Why are you using a CGLIB beta?
I would swear I once knew how to obtain bytecode from a running Sun JVM - but I can't remember anymore. It might have involved using the JVM debug interfaces or...
When using the xml style of Spring AOP you cannot refer to parameterized pointcuts. Inline the "successfulExecution" pointcut and things will work as expected. :)
I was thinking that spring perhaps wanted a "arg-names" attribute that specified the name of the "JoinPoint"/"ProceedingJoinPoint" parameter. However, it seems not to be the case.
Can you provide...
Add argNames annotation parameter?
So, it's undocumented in AspectJ as well? :)
Yes, obviously aligning the two styles is what this is all about.
Let me explain my other question:
argNames is part of AspectJ 5, for example org.aspectj.lang.annotation.Before declares it as an...
So, any news which variation (with or without PJP) will be valid?
Does "core" AspectJ actually specify this, or is it undocumented there as well? :)
I've converted a number of aspects from @Aspect to "schema" style of AOP.
I was using "argNames" in the Java annotations, and converted that to "arg-names" attributes on <aop:around> etc.
Most...