common utility aspects to use when creating systems with [spring-aop]
Questions tagged [spring-aspects]
129 questions
1
vote
2 answers
Spring 4 method interceptor and use custom implementation
I have following classes and interface
interface abc {
public A do();
}
package x;
public Impl1 implements abc{
public A do(){
}
}
package y;
public Impl2 implements abc{
public A do(){
}
}
I don't have the source code of Impl1 or Impl2.…

Debopam
- 3,198
- 6
- 41
- 72
1
vote
1 answer
Get the name of the "method argument" in aspect ? (AspectJ)
How can I get the name of argument in aspect, for example if my method is test(Sample sampleDto), I need know the name of sampleDto in my aspect. How get it from ProceedingJoinPoint ?
I try this, but I get null.
String[] argumentsName =…

Hamid
- 153
- 1
- 2
- 9
1
vote
1 answer
@EnableTransactionManagement(mode = AdviceMode.ASPECTJ) not working on JBOSS
I'd like to use ASPECTJ load time weaving with my Spring database transactions (running on JBOSS). I've wasted an entire day on this but can't get it working correctly.
I've pasted my Java code and also the server's output below. It's supposed to…

craigrs84
- 3,048
- 1
- 27
- 34
1
vote
1 answer
Why would switching from AspectJ to Proxy mode cause a "TransactionRequiredException: Executing an update/delete query" to no longer occur?
I have an issue with my use of Spring Data Jpa & Hibernate.
Here is the exception I get:
2017-05-21 21:42:20.761 DEBUG 11765 --- [nio-8080-exec-5] o.h.e.t.internal.TransactionImpl : committing
2017-05-21 21:42:20.765 INFO 11765 ---…

balteo
- 23,602
- 63
- 219
- 412
1
vote
0 answers
Suppress Spring Advice in some cases
I have a method and around advice on that method. When that method gets called, advice is getting applied on it.
methodA();
In a special case, when that method gets from another method, I would like to suppress advice getting applied on it. When…

Parth Thacker
- 11
- 1
1
vote
1 answer
Spring MVC and AOP: @Pointcuts only apply for Rest Controllers and not for common Web Controllers
I am working with Spring Framework 4.3.3 in a web environment.
I have a @Controller used for Web requests through a Web Browser that uses how dependency other @Controller but for Rest purposes. It latter mentioned uses a @Service etc...
This…

Manuel Jordan
- 15,253
- 21
- 95
- 158
1
vote
1 answer
@AspectJ aspects not being weaved in application that uses Spring
I have added the line
to my application-context.xml,
and have created a META-INF\aop.xml file with the following:

jhwang
- 43
- 7
1
vote
2 answers
Spring AOP : Interface method with Parameter annotation captured, but annotation is not present
I'm using Spring AOP to intercept a method execution.
I have an interface that looks like the following:
public interface MyAwesomeService {
public Response doThings(int id, @AwesomeAnnotation SomeClass instance);
}
Here is the implementation…

n00bc0der
- 103
- 1
- 3
- 9
1
vote
0 answers
Why Spring Security doesn't allow the authentication for 'anonymousUser'?
This is the message that I have in the Spring logs:
[DEBUG] 2016-04-22 10:39:19,469 [] [-254028363] org.springframework.security.web.access.intercept.FilterSecurityInterceptor authenticateIfRequired - Previously Authenticated:…

Alessandro C
- 3,310
- 9
- 46
- 82
1
vote
1 answer
Spring AOP is being invoked unexpectedly
I have configured Spring AOP for 2 different packages in our application to log exceptions.
There are 2 different configurations for each package:

Rahul
- 637
- 5
- 16
1
vote
2 answers
How to enable Spring retry using version Spring Retry of 1.0.3?
To enable Spring retry one can either enable retry in Java annotation: @EnableRetry within Configuration or specify retry in an XML configuration file:

Alex
- 7,007
- 18
- 69
- 114
1
vote
2 answers
Applying custom annotation advice to spring data jpa repository
I am working on a mysql master slave replication. I am using spring data jpa(spring boot).
What I needed is all write operations to go to master server and read-only operations to be equally distributed among multiple read-only slaves.
For that I…

Bhupati Patel
- 1,400
- 2
- 13
- 18
1
vote
1 answer
How to set .classpath in STS (eclipse) by gradle for AspectJ and spring-aspects
I have a project using compile time weaving for @Configurable from spring-aspects into my classes using the @Configurable.
I use the Spring Tool Suite 3.7.0 and got everything running if I use gradle tasks to build and start my application. (Thanks…

timguy
- 2,063
- 2
- 21
- 40
1
vote
3 answers
how to access custom annotation values in spring aspect
I am trying to access the custom annotation values from jointCut. But I couldn't find a way.
My sample code :
@ComponentValidation(input1="input1", typeOfRule="validation", logger=Log.EXCEPTION)
public boolean validator(Map mapStr) {
…

pradeep cs
- 513
- 4
- 9
- 34
1
vote
1 answer
Spring AOP: Aspect class is not executed
I have defined an aspect which should be executed when the method getFirstName() is called on the User object. But it does not happen.
My Aspect class:
@Component
@Aspect
public class JpaGetFirstNameAspect {
@Pointcut("execution(*…

Asad Khan
- 61
- 6