I am creating a simple AOP program and starting getting BeanCurrentlyInCreationException
exception with it.
Here is my code:
MyAspect.ja
I tried with the same piece of code mentioned in the post and defined the Bean in Config.java and it worked for me. The only error i got using this program is in the MyAspect class the
'advice must be public'
@Before("anyPublicOperation()")
public void beforePointCut(){
System.out.println("Inside before pointcut of MyAspect");
}
Rest executed fine. Also you could try the previous code by refreshing the context before using
ApplicationContext context = new AnnotationConfigApplicationContext();
((AnnotationConfigApplicationContext) context).register(Config.class);
((AbstractApplicationContext) context).refresh();