Questions tagged [aspectj]

AspectJ is an aspect-oriented extension to the Java programming language that enables clean modularization of crosscutting concerns such as logging, error handling, standards enforcement and feature variations. Use this tag for questions about the programmatic use of this extension. For downloads, support, IDE integration, & documentation, see the "learn more" for this tag.

AspectJ is an Aspect-Oriented Programming (AOP) extension to Java, created by Xerox, that has as main components aspects (consisting of pointcuts and advices) and join points.

For AspectJ Eclipse integration, also see AspectJ Development Tools (AJDT); for NetBeans integration, see AspectJ in NetBeans; for IntelliJ IDEA integration, see IDEA Web Help.

Books:

Documentation:

3304 questions
1
vote
1 answer

Drop wizard AspectJ metrics does not report metrics via JConsole MBeans

I have tried to follow the instructions to get drop wizard AspectJ metrics working, see https://github.com/astefanutti/metrics-aspectj however when I follow these simple instructions and view the metrics through JConsole mbeans there are no metrics…
pootle5
  • 21
  • 3
1
vote
0 answers

Aspect is not intercepting HttpStatusReturningLogoutSuccessHandler.onLogoutSuccess() method

I am using Spring security to authenticate my users. I am trying to log users login and logout activity. I was able to intercept the login using pointcut expression…
baymax
  • 11
  • 1
1
vote
0 answers

Spring Tool Suite: NullpointerException at "Push In" operation

I used Spring Tool Suite with Spring Roo to reverse engineer a database. Now I want to remove the AspectJ Files from my project and obtain standard JavaEE classes. To do so, I did a right click on my project --> Refactor --> Push In... After this,…
YellowSub
  • 179
  • 2
  • 11
1
vote
1 answer

Aspect around call on annotated field

I want AspectJ to inject the measuring code around all invocations of any method, on fields annotated with @Measured and capture the method's name. This is what I have: @Pointcut("get(@my.annotation.Measured * *) && @annotation(measured)") public…
boneash
  • 158
  • 1
  • 3
  • 19
1
vote
1 answer

has AspectJ execution in thread-safe?

Knowledge question = no code, no error, no examples to reports. I applied a joinpoint over method() of ClassA, and ClassA is not a singleton. I create MyAspect that handle this joinpoint. Question: if there are 2 callers of ClassA.method(), and…
Giorgio Desideri
  • 169
  • 1
  • 12
1
vote
2 answers

Spring @Aspect not autowiring correctly

I have the following code: package com.cooldomain.coolapp.application.rest.session; import javax.annotation.PostConstruct; import javax.servlet.http.HttpServletRequest; import org.aspectj.lang.ProceedingJoinPoint; import…
Mr. Smith
  • 53
  • 3
1
vote
1 answer

kamon akka 2.4 throws a java.lang.VerifyError

I am using Kamon version 0.6.1 and akka 2.4.6 and scala 2.11.8. I have done the necessary configurations in my application.conf and I am starting my application using the javaagent .However i get a java.lang.VerifyError . Here are my details…
Raveesh Sharma
  • 1,486
  • 5
  • 21
  • 38
1
vote
1 answer

AspectJ Maven Compiler Plugin Failing for Java 8

I've written a maven module which uses AspectJ, and I'm compiling it with the AspectJ compiler plugin. I've written some unit tests which use Java 8 predicates, and when I run mvn clean install, the tests fail with this error: error: lambda…
TheRealJimShady
  • 3,815
  • 4
  • 21
  • 40
1
vote
1 answer

Can you specify a pointcut which corresponds to every line of execution in AspectJ

I know you can specify code to be run in a wide variety of situations like when an exception is throw, method is executed, method is called, etc. Is there any way that I can specify code to be run after every single line of execution of a given…
Ogen
  • 6,499
  • 7
  • 58
  • 124
1
vote
1 answer

Disabling AspectJ to stop advicing method with if() method and user's input

I am using AspectJ with annotation and trying to find how to disable all AspectJ's advices to stop advicing method from user's input (e.g. Boolean tracked = false). Here is my code for main class. package testMaven; public class MainApp { …
Ihsan Haikal
  • 1,085
  • 4
  • 16
  • 42
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
1 answer

maven aspectj weaving NullPointerException

I have a Spring MVC application made with MyEclipse, which contains generated sources as well as my own sources, plus aspects that I defined on the generated classes. Everything compiled fine in MyEclipse, but I want now to switch to Maven in order…
risoldi
  • 449
  • 5
  • 16
1
vote
0 answers

SpringAOP AspectJ Initialized super.instance variable found to be null NPE

Am trying to integrate Aspects to old monolithic Spring MVC application configured via XML schema. Spring AOP is configured via & The delegate bean schema definition &…
Mithun PG
  • 21
  • 3
1
vote
2 answers

aop.xml name and location?

Is there a way to specify the name of the aop.xml file with LTW? or define another name and location? I have several software modules that I use and that all use META-INF/aop.xml with different settings. I include these modules in a web application…
edbras
  • 4,145
  • 9
  • 41
  • 78
1
vote
3 answers

@AspectJ pointcut for execute methods of a package that contains keyword service

I'm trying to intercept all classes that contains a specific word in their package name... something as below: @Pointcut("execution(* *..service..*.*(..))") I have all the classes in the packages to…