[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ews.eclipse.technology.aspectj] Re: java.lang.NoSuchFieldError: ajc$cflowCounter$0

Yikes ... I worry I know whats going wrong here. but let's for now imagine it isnt that because its too hard to fix. Can you tell me if it works if you do source or binary weaving rather than load time weaving?

Andy.

Barry Kaplan wrote:
Sorry, the final after-returning was (ie, no recursion):

@AfterReturning("beanCreation(beanInstance) && !cflow(hibernateUnsavedValueFactory())")
public void configure(Object beanInstance) {
configureBean(beanInstance);
}



Barry Kaplan wrote:

I cannot seem to get a cflow to work:

// @Pointcut("call(* org.hibernate.engine.UnsavedValueFactory.instantiate(..)) && within(org.hibernate.engine.UnsavedValueFactory)")
@Pointcut("execution(* org.hibernate.engine.UnsavedValueFactory.instantiate(..))")
void hibernateUnsavedValueFactory() {}
@Pointcut("initialization((@org.springframework.beans.factory.annotation.Configurable *).new(..)) && this(beanInstance)")
void beanCreation(Object beanInstance) {}
// @Before("hibernateUnsavedValueFactory()")
public void test() {
throw new RuntimeException("*****");
}
@AfterReturning("beanCreation(beanInstance) && !cflow(hibernateUnsavedValueFactory())")
public void configure(Object beanInstance) {
configure(beanInstance);
}


The test() advice will trigger if uncommented. But the use of the hibernateUnsavedValueFactory() pointcut in the cflow always generates the NoSuchFieldException. I am using runtime weaving. I am really confused.

-barry