Dustin Schultz | 4 Jan 19:23 2013
Picon

ReflectionWorld.resolve(String) and Dynamic Proxy Classes

Hi,

I was going to file a bug about this but wanted to ask first before doing so: 

Is there any particular reason that ReflectionWorld.resolve(String) tries to resolve dynamic proxy classes by name? Class.getName() for dynamic proxies always returns $Proxy# and ReflectionWorld can never resolve them which always results in a cantFindType error.

Granted, I can turn down cantFindType to warning, the default in Xlint.properties is error. We're currently experiencing this when Spring goes looking for beans to advise. It runs into a bean that is already proxied (an OSGi service reference) and then blows up.

Thanks,
Dustin Schultz
_______________________________________________
aspectj-users mailing list
aspectj-users <at> eclipse.org
https://dev.eclipse.org/mailman/listinfo/aspectj-users
Dustin Schultz | 4 Jan 19:31 2013
Picon

Re: ReflectionWorld.resolve(String) and Dynamic Proxy Classes

Also, here is the relevant method which calls resolve() is PointcutExpressionImpl:

public boolean couldMatchJoinPointsInType(Class aClass) {
ResolvedType matchType = world.resolve(aClass.getName());
}

Thanks,
Dustin Schultz
From: Dustin Schultz <dustin.schultz <at> utah.edu>
Reply-To: "aspectj-users <at> eclipse.org" <aspectj-users <at> eclipse.org>
Date: Friday, January 4, 2013 11:23 AM
To: "aspectj-users <at> eclipse.org" <aspectj-users <at> eclipse.org>
Subject: [aspectj-users] ReflectionWorld.resolve(String) and Dynamic Proxy Classes

Hi,

I was going to file a bug about this but wanted to ask first before doing so: 

Is there any particular reason that ReflectionWorld.resolve(String) tries to resolve dynamic proxy classes by name? Class.getName() for dynamic proxies always returns $Proxy# and ReflectionWorld can never resolve them which always results in a cantFindType error.

Granted, I can turn down cantFindType to warning, the default in Xlint.properties is error. We're currently experiencing this when Spring goes looking for beans to advise. It runs into a bean that is already proxied (an OSGi service reference) and then blows up.

Thanks,
Dustin Schultz
_______________________________________________
aspectj-users mailing list
aspectj-users <at> eclipse.org
https://dev.eclipse.org/mailman/listinfo/aspectj-users
Andy Clement | 7 Jan 22:51 2013
Picon

Re: ReflectionWorld.resolve(String) and Dynamic Proxy Classes

Hi Dustin,

I think it is probably just the case that there is no special handling for dynamic proxies in there. I would be OK with making a change to recognize the situation sooner and circumvent the unhelpful message.  I'd need a testcase before I could do the work myself but if you wanted to come up with a patch, I'd take that (I'd just have to confirm all the Spring test suites still pass with it in place, which I can do, I don't have a comprehensive AspectJ test suite for reflection world).

cheers,
Andy


On 4 January 2013 10:31, Dustin Schultz <dustin.schultz <at> utah.edu> wrote:
Also, here is the relevant method which calls resolve() is PointcutExpressionImpl:

public boolean couldMatchJoinPointsInType(Class aClass) {
ResolvedType matchType = world.resolve(aClass.getName());
}

Thanks,
Dustin Schultz
From: Dustin Schultz <dustin.schultz <at> utah.edu>
Reply-To: "aspectj-users <at> eclipse.org" <aspectj-users <at> eclipse.org>
Date: Friday, January 4, 2013 11:23 AM
To: "aspectj-users <at> eclipse.org" <aspectj-users <at> eclipse.org>
Subject: [aspectj-users] ReflectionWorld.resolve(String) and Dynamic Proxy Classes

Hi,

I was going to file a bug about this but wanted to ask first before doing so: 

Is there any particular reason that ReflectionWorld.resolve(String) tries to resolve dynamic proxy classes by name? Class.getName() for dynamic proxies always returns $Proxy# and ReflectionWorld can never resolve them which always results in a cantFindType error.

Granted, I can turn down cantFindType to warning, the default in Xlint.properties is error. We're currently experiencing this when Spring goes looking for beans to advise. It runs into a bean that is already proxied (an OSGi service reference) and then blows up.

Thanks,
Dustin Schultz

_______________________________________________
aspectj-users mailing list
aspectj-users <at> eclipse.org
https://dev.eclipse.org/mailman/listinfo/aspectj-users


_______________________________________________
aspectj-users mailing list
aspectj-users <at> eclipse.org
https://dev.eclipse.org/mailman/listinfo/aspectj-users
jborrmann | 8 Jan 07:34 2013
Picon

Re: ReflectionWorld.resolve(String) and Dynamic Proxy Classes

Hi Andy and Dustin,

interesting that you stumbled upon the same issue as we did (see
http://forum.springsource.org/showthread.php?95314-ReflectionWorldExpression-when-upgrading-Aspectj).
If I understand your description right, you are also not only confronted with an
irritating error message but with spring contexts not being initialized, right?

Cheers,
Jens
Dustin Schultz | 8 Jan 16:49 2013
Picon

Re: ReflectionWorld.resolve(String) and Dynamic Proxy Classes

Hi Jens,

Ya, we're experiencing the same problem. The Spring context fails to load.
I also noticed that it doesn't happen prior to 1.6.7. I don't know the
exact reason why but I suspect it has to do with the Fast Matching turned
on by default in 1.6.7. Unfortunately my attempts to disable it within an
OSGi environment have failed. You might have better luck if you're working
in a standard environment and configure aop.xml.

Thanks,
Dustin Schultz

On 1/7/13 11:34 PM, "jborrmann" <Jens.Borrmann <at> msg-gillardon.de> wrote:

>Hi Andy and Dustin,
>
>interesting that you stumbled upon the same issue as we did (see
>http://forum.springsource.org/showthread.php?95314-ReflectionWorldExpressi
>on-when-upgrading-Aspectj).
>If I understand your description right, you are also not only confronted
>with an
>irritating error message but with spring contexts not being initialized,
>right?
>
>Cheers,
>Jens
>
>
>_______________________________________________
>aspectj-users mailing list
>aspectj-users <at> eclipse.org
>https://dev.eclipse.org/mailman/listinfo/aspectj-users
jborrmann | 9 Jan 09:22 2013
Picon

Re: ReflectionWorld.resolve(String) and Dynamic Proxy Classes


> 
> Hi Jens,
> 
> Ya, we're experiencing the same problem. The Spring context fails to load.
> I also noticed that it doesn't happen prior to 1.6.7. I don't know the
> exact reason why but I suspect it has to do with the Fast Matching turned
> on by default in 1.6.7. Unfortunately my attempts to disable it within an
> OSGi environment have failed. You might have better luck if you're working
> in a standard environment and configure aop.xml.
> 
> Thanks,
> Dustin Schultz
> 

Hi Dustin,

we also use OSGi. Therefore simply using an aop.xml was not very promising to us.

We tried to isolate this nasty thing and finally found a workaround for our
problem. May this helps in your case, too. While debugging we saw that the error
occurs when proxies for exported osgi services (<blueprint:service ...>  are
handled. These are instances of OsgiServiceProxyFactoryBean.

So we added a package import for this package to our manifest:

org.eclipse.gemini.blueprint.service.exporter.support;version="1.0.2.RELEASE",

And after subsequent debugging we added some more import statements:

org.springframework.aop;version="3.2.0.RELEASE",
org.springframework.aop.aspectj;version="3.2.0.RELEASE",
org.springframework.aop.framework;version="3.2.0.RELEASE",
org.springframework.aop.interceptor;version="3.2.0.RELEASE",

Now everything works like a charm. I am not really sure wether this is the right
solution or just a hacky workaround for the real problem. If it is the solution
at least better diagnosing messages would be needed.

Any opinions about our findings?

Cheers, Jens
Andy Clement | 8 Jan 17:44 2013
Picon

Re: ReflectionWorld.resolve(String) and Dynamic Proxy Classes

Hi Jens,

I wasn't aware of that spring aop forum post (there are too many forums to track...). If either you or Dustin comes up with a testcase I can take a proper look at the situation.  There was a lot of change that went in around 1.6.7 (although 1.6.7 itself wasn't a great build, 1.6.8 was released pretty soon after to address some issues).  I probably wouldn't recommend attempting to turn off fast matching as running the old matching algorithms isn't really supported (and no testing is done to confirm the old matching algorithms still work in more recent builds).

cheers,
Andy


On 7 January 2013 22:34, jborrmann <Jens.Borrmann <at> msg-gillardon.de> wrote:
Hi Andy and Dustin,

interesting that you stumbled upon the same issue as we did (see
http://forum.springsource.org/showthread.php?95314-ReflectionWorldExpression-when-upgrading-Aspectj).
If I understand your description right, you are also not only confronted with an
irritating error message but with spring contexts not being initialized, right?

Cheers,
Jens


_______________________________________________
aspectj-users mailing list
aspectj-users <at> eclipse.org
https://dev.eclipse.org/mailman/listinfo/aspectj-users

_______________________________________________
aspectj-users mailing list
aspectj-users <at> eclipse.org
https://dev.eclipse.org/mailman/listinfo/aspectj-users
Dustin Schultz | 8 Jan 16:50 2013
Picon

Re: ReflectionWorld.resolve(String) and Dynamic Proxy Classes

Hi Andy,

Thanks for your response. I'll see if I can work on a test case this week.

Thanks,
Dustin Schultz

From: Andy Clement <andrew.clement <at> gmail.com>
Reply-To: "aspectj-users <at> eclipse.org" <aspectj-users <at> eclipse.org>
Date: Monday, January 7, 2013 2:51 PM
To: "aspectj-users <at> eclipse.org" <aspectj-users <at> eclipse.org>
Subject: Re: [aspectj-users] ReflectionWorld.resolve(String) and Dynamic Proxy Classes

Hi Dustin,

I think it is probably just the case that there is no special handling for dynamic proxies in there. I would be OK with making a change to recognize the situation sooner and circumvent the unhelpful message.  I'd need a testcase before I could do the work myself but if you wanted to come up with a patch, I'd take that (I'd just have to confirm all the Spring test suites still pass with it in place, which I can do, I don't have a comprehensive AspectJ test suite for reflection world).

cheers,
Andy


On 4 January 2013 10:31, Dustin Schultz <dustin.schultz <at> utah.edu> wrote:
Also, here is the relevant method which calls resolve() is PointcutExpressionImpl:

public boolean couldMatchJoinPointsInType(Class aClass) {
ResolvedType matchType = world.resolve(aClass.getName());
}

Thanks,
Dustin Schultz
From: Dustin Schultz <dustin.schultz <at> utah.edu>
Reply-To: "aspectj-users <at> eclipse.org" <aspectj-users <at> eclipse.org>
Date: Friday, January 4, 2013 11:23 AM
To: "aspectj-users <at> eclipse.org" <aspectj-users <at> eclipse.org>
Subject: [aspectj-users] ReflectionWorld.resolve(String) and Dynamic Proxy Classes

Hi,

I was going to file a bug about this but wanted to ask first before doing so: 

Is there any particular reason that ReflectionWorld.resolve(String) tries to resolve dynamic proxy classes by name? Class.getName() for dynamic proxies always returns $Proxy# and ReflectionWorld can never resolve them which always results in a cantFindType error.

Granted, I can turn down cantFindType to warning, the default in Xlint.properties is error. We're currently experiencing this when Spring goes looking for beans to advise. It runs into a bean that is already proxied (an OSGi service reference) and then blows up.

Thanks,
Dustin Schultz

_______________________________________________
aspectj-users mailing list
aspectj-users <at> eclipse.org
https://dev.eclipse.org/mailman/listinfo/aspectj-users


_______________________________________________
aspectj-users mailing list
aspectj-users <at> eclipse.org
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Gmane