Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 336471

Summary: Problem with a call pointcut and thisJoinPointStaticPart.getSourceLocation()/thisEnclosingJoinPointStaticPart.getSourceLocation() statements
Product: [Tools] AspectJ Reporter: PASTUREL <jeanlouis.pasturel>
Component: LTWeavingAssignee: aspectj inbox <aspectj-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: aclement
Version: DEVELOPMENT   
Target Milestone: 1.6.11   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description PASTUREL CLA 2011-02-07 02:06:31 EST
LTW weaving, snapshot aspectJ dev build of 03 February 2011 ( but same behaviour with others versions). I don't use Spring AOP agent, i use aspectjweaver "native" javaagent.
 
does this Exception mean anything to you ?
 
With a execution pointcut  no problem because thisJoinPointStaticPart and thisEnclosingJoinPointStaticPart.getSourceLocation() are the same JoinPoint.
 
Whit call pointcut,  when thisEnclosingJoinPointStaticPart.getSourceLocation() runs i get this exception 
 
10:01:44,337 ERROR ContextLoader(215) - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean wit
h name 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostPr
ocessor#0' defined in ServletContext resource [/WEB-INF/jpaDaoContext.xml]: Init
ialization of bean failed; nested exception is org.springframework.beans.factory
.BeanCreationException: Error creating bean with name 'myEntityManagerFactory' d
efined in ServletContext resource [/WEB-INF/jpaDaoContext.xml]: Invocation of in
it method failed; nested exception is java.lang.NoSuchMethodError: org.aspectj.r
untime.reflect.Factory.makeESJP(Ljava/lang/String;Ljava/lang/String;Ljava/lang/S
tring;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)
Lorg/aspectj/lang/JoinPoint$EnclosingStaticPart;
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory$1.run(AbstractAutowireCapableBeanFactory.java:409)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBean(AbstractAutowireCapableBeanFactory.java:380)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
ject(AbstractBeanFactory.java:264)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
y.getSingleton(DefaultSingletonBeanRegistry.java:222)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
an(AbstractBeanFactory.java:261)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:185)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:164)
        at org.springframework.context.support.AbstractApplicationContext.getBea
n(AbstractApplicationContext.java:880)
        at org.springframework.context.support.AbstractApplicationContext.regist
erBeanPostProcessors(AbstractApplicationContext.java:596)


Andy reply :
"Interesting!  I don't think we've ever had a method like that:

org.aspectj.runtime.reflect.Factory.makeESJP(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)

In the runtime.  Can you raise a bugzilla? When you say it happens with other versions, how far back did you try, 1.6.9?  I only ask because some changes went in around that area in 1.6.10 to enable us to produce smaller code when joinpoints didn't have certain characteristics (e.g. no exceptions).

Andy

"
I had just tested with 1.6.11 dev versions. I will try with a 1.6.9 version and i let you know.
Comment 1 PASTUREL CLA 2011-02-07 02:49:14 EST
I just do the same test with a 1.6.9 version, and i don't get the exception with the call pointcut.
The thisEnclosingJoinPointStaticPart.getSourceLocation() runs correctly.
Comment 2 Andrew Clement CLA 2011-02-07 11:31:06 EST
As a workaround you could try:

-Xajruntimetarget:1.2
Comment 3 Andrew Clement CLA 2011-02-07 17:36:01 EST
I presume you aren't using this option:

-Xset:targetRuntime1_6_10=true
Comment 4 PASTUREL CLA 2011-02-08 01:32:36 EST
I *use* -Xset:targetRuntime1_6_10=true and got the exception.
I will try without it and let you know. I will test also -Xajruntimetarget:1.2 ( i suppose in ant aj task)
Comment 5 PASTUREL CLA 2011-02-08 05:00:30 EST
Removing the parameter  -Xset:targetRuntime1_6_10=true from aop.xml file correct also the problem.
Comment 6 Andrew Clement CLA 2011-02-08 11:23:01 EST
> I *use* -Xset:targetRuntime1_6_10=true and got the exception.

Thanks for confirming that, I couldn't understand how the problem could be occurring without that option.

Fixed.