Questions tagged [spring-aspects]

common utility aspects to use when creating systems with [spring-aop]

129 questions
0
votes
0 answers

(ClassGenException) Couldn't find target for branch: ifeq[153]

Aspectj version : 1.8.13 I have a project which I am trying to run through aspect compiler through maven plug-in but getting following error. Any pointers to debug this issue or find the exact issue where it lies? . The error couldn't find the…
0
votes
0 answers

Exception in Spring AOP Itself not getting handled through RestControllerAdvice

I need to validate the HttpServletRequest for certain attribtues in my service layer before proceeding. I created @Before advice, Please note that AOP method throws Exception. I want exception thrown by this method should be handled by…
Vikky
  • 1,123
  • 14
  • 16
0
votes
1 answer

Run Spring aspect advice on executing thread

I have a scenario in my springboot application, where I submit tasks into a threadpool for async execution.Now some of the methods inside child execution is part of aspect point advice with @AfterReturn. I observe that even if processing is done…
0
votes
1 answer

Spring aop pointcut expression across other projects is not applied

The project structure is spring-contract spring-aop as dependency of (1) spring-service as dependency of (2). I have a param annotation @MyAnnotation in spring-contract project, an aspect class in spring-aop, package com.learning.aspect; import…
tinker_fairy
  • 1,323
  • 1
  • 15
  • 18
0
votes
1 answer

Spring AOP get modified parameter values

I have two Spring aspects (let's call them Aspect1 and Aspect2). Aspect1 is executed before Aspect2, Aspect1 is a logging aspect, Aspect2 is an authentication aspect that will potentially update the value of one method parameter using the…
Cheng Chen
  • 151
  • 1
  • 11
0
votes
1 answer

Is there anyway to create a Spring Aspect advice that triggers on any method that is NOT annotated by certain annotation?

Basically I am trying to create a log system that will log most of the controller methods (their parameters, bodies, status codes and so on), however, there are few controller methods I do not want to log for some specific reasons. I do not want to…
Cheng Chen
  • 151
  • 1
  • 11
0
votes
3 answers

Spring AOP pointcut expression excluding a particular return type or argument

@AfterReturning(value = "execution(* org.springframework.data.repository.CrudRepository.save(..)) ", returning = "result") public void repo(JoinPoint joinPoint, Object result) { // ... } This pointcut covers all save or update operations…
Priyam
  • 153
  • 1
  • 1
  • 12
0
votes
1 answer

Inject paramater into Spring Aspect Advice

I have a basic spring rest controller and have a company requirement which needs to log request and response in one combined log message. I planned on doing this with some simple aspect. However the controller calls a service which in turn calls…
0
votes
2 answers

Spring Aspect - How to identify which Pointcut triggers the function

I want to log Controller and the rest of packages differently. I know I can use 2 separate methods for this but these 2 methods are very similar, so I want to add a code to check that would look something like this @Around("controllerPoint() ||…
Muse
  • 13
  • 2
0
votes
2 answers

Spring AOP pass String argument of a controller method

I have a controller class with one RequestMapping method which is taking String arguments. I want to pass this argument by using Spring AOP but its failing, I am getting null value when I am printing the value. Tried with the below provided solution…
user995656
  • 123
  • 1
  • 14
0
votes
0 answers

Weave dependency in maven with AspectJ not working

I have a requirement to intercept certain method for apache POI API(HSSFCell setCellValue), and I planed to use Spring AspectJ to fulfill this requirement. But after some testing I found it's not working. Not sure it that possible to weave the…
Koenigsegg
  • 575
  • 1
  • 9
  • 23
0
votes
1 answer

IBM JDK throwing error 0 class {0} is already woven and has not been built in reweavable mode [Xlint:nonReweavableTypeEncountered]

We have few aspects, Aspect classes are defined with @Aspect and declared the same aspect in METAINFO/aop.xml: aop.xml
Madhusudana
  • 302
  • 3
  • 12
0
votes
0 answers

after importing spring-aspects,some controller not found

I write 2 controllers--GoodController and UserController, after importing spring-aspects, my UserController url 404, but GoodController is normal, I can't find the reason and don't know how to resolve. All my pom.xml is bellow: project parent…
0
votes
1 answer

Get return value in custom annotation spring aop

I have write a simple custom annotation to set HttpHeaders to ResponseEntity because of duplicating the code every where . Annotation Interface and Class. @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface JsonHeader…
Shalika
  • 1,457
  • 2
  • 19
  • 38
0
votes
1 answer

How to exclude classes from triggering Aspect method call

I have a method in an @Aspect service method called logChangesAndAnnounceNewContributions that fires whenever somewhere in the webapp the save method of Spring-data's JpaRepository is called. I don't want the logChanges method to be called when the…
Maurice
  • 6,698
  • 9
  • 47
  • 104
1 2 3
8 9