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

Can you not just put the aspect into your java project and convert it to an AJ project? Or are you applying the aspect to code you dont have the source for?

Andy.

Barry Kaplan wrote:
Sigh, you gonna make me have to understand the confusing AJDT in/out/aspect path stuff.... Arrg, load time is sooo much easier. Ok, I'll try. Back soon.

-barry

Andy Clement wrote:

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