common utility aspects to use when creating systems with [spring-aop]
Questions tagged [spring-aspects]
129 questions
0
votes
0 answers
@Cachable annotation breaks existing aspects on method
I have a method that was annotated with @RolesAllowed from javax.annotation.security which is used by an existing aspect.
We are adding spring caching support to our service layer. The caching works just fine but we noticed that any @Cach*…

Justin ross
- 69
- 6
0
votes
1 answer
spring aspect not getting fired on getConnection
I am trying to intercept the getConnection call in spring 3.2.3
@Component
@Aspect
@Order(value = 1)
public class ConnectionAspect {
//@AfterReturning(pointcut = "execution(java.sql.Connection javax.sql.DataSource.getConnection(..))", returning…

lives
- 1,243
- 5
- 25
- 61
0
votes
1 answer
How to print some logs "before" a spring-data repository method, without custom repo
I have a Spring data repository.
When http://localhost:8080/persons webservice is called, I want to log something. I DO NOT want to make MyCustomRepository<>. Cleaner options?
Repo class:
@RepositoryRestResource(collectionResourceRel = "persons",…

Espresso
- 5,378
- 4
- 35
- 66
0
votes
2 answers
Spring AOP. How to make pointcut for all public methods in annotated class
I need to handle all the exceptions that are thrown from public methods of class annotated with some annotation.
I trying to use Spring AOP. This is my logger:
@Aspect
public class Logger {
private final Logger log =…

Kirill
- 1,540
- 4
- 18
- 41
0
votes
3 answers
IntelliJ IDEA "Cannot resolve method" on aspect-defined method
I am using spring-data-neo4j 3.4.2, which is (optionally) using AspectJ.
My IDE is IntelliJ IDEA 16 (EAP, IU-144.3891.8). I have had the same problem using latest IntelliJ IDEA 15.
Everything works fine so far within IntelliJ, I can compile, run my…

Markus Schulte
- 4,171
- 3
- 47
- 58
0
votes
1 answer
How to advice flowscope bean in Spring webflow
My project is using Spring web flow 2.4, and I need to use Spring AOP to advice flow scope bean to handle aspect requirement like logging.
Here is the aspect class:
@Aspect
@Component
public class LogFlowEventExecutor {
…

Simon L
- 173
- 1
- 11
0
votes
1 answer
Must set property 'expression' before attempting to match
When I was trying to solve this SO question...
I faced
Must set property 'expression' before attempting to match

Betlista
- 10,327
- 13
- 69
- 110
0
votes
0 answers
How to use Spring AOP's Aspect to do very complex audit logging?
I'm building a Spring web application. Using Spring AOP's aspect to do audit logging.
I've got business class with methods like the following and i want to audit log in certain cases
during method execution
after method returns
@Aspect
public…

SoftwareDeveloper
- 1,094
- 2
- 15
- 26
0
votes
0 answers
why I do not have transaction when I use aspectJ mode transaction?
I have service layer like this:
@Service
@Transactional
public class TransactionService {
@Autowired
private TransactionDao dao;
@Transactional(propagation = Propagation.REQUIRED)
public void A() {
...
B();
}
…

grep
- 5,465
- 12
- 60
- 112
0
votes
1 answer
Spring Aspects: specify which packages to weave
I have a Spring / Hibernate application. Custom type created by Hibernate needs Spring context, so I use Spring Aspects to provide it.
@Configurable(preConstruction = true)
public class EncryptedStringUserType implements EnhancedUserType…

Marboni
- 2,399
- 3
- 25
- 42
0
votes
1 answer
Aspect does not get triggered in the context of listening for a RabbitMQ message
The FailedMessageAspect.afterMethod() below gets called successfully during RabbitConsumerMain.main() below. However, it doesn't get called when it's used in the context of listening for a RabbitMQ message - when MessageHandlerImpl.handleMesasge()…

Glide
- 20,235
- 26
- 86
- 135
0
votes
1 answer
Spring-Aspect - find if method call stack has specific package classes
I'm very new to Spring-Aspect. In fact, I just need to make a fix, while never implemented with aspect before.
So, I have the following classes (not real names :D):
Validate in package com.my which calls
ValidateService which calls
DAO
What I need…

vanHooijdonk
- 21
- 3
0
votes
0 answers
AspectJ Joinpoint in a Spring Repository
I am trying to intercept calls to my Repository.save method. This is basically explained Here and Here. The only problem is it simply doesn't work. I am obviously missing something but after many hours I'm at a loss for what.
I am using Spring…

Terry
- 911
- 10
- 26
0
votes
0 answers
Not able to Autowire Spring Bean in Spring AOP aspect
I have a new Aspect created and its not loading the autowired bean
@Aspect
@Component
public class LoggingAspect {
private static final Logger logger = LoggerFactory.getLogger(LoggingAspect.class);
@Autowired
private EmployeeService…

saysiva
- 810
- 1
- 7
- 11
0
votes
0 answers
How to define aspects and pointcuts in WildFly?
We are migrating from JBoss 5 to WildFly 8.2. Still using Spring 3.1. Suddenly none of our aspects can be found when application starts.
We might have solved (partially) the XML configuration (by placing more wildcards around), but annotation based…

Nikolay
- 101
- 1
- 8