You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by nicolas de loof <ni...@gmail.com> on 2009/05/04 15:26:53 UTC
issue with and Spring-aop
Hi guys,
I'm running into a CGLIB issue when trying to setup spring-aop on :
<jaxws:client id="metierServicePortType"
serviceClass="....MetierServicePortType"
address="${metierService.url}">
</jaxws:client>
My monitoring framework uses spring-AOP (ApscetJ syntax) to instrument beans
:
@Around( "SystemArchitecture.externalWebServiceCall()" )
public Object log( ProceedingJoinPoint jp ) { ... }
@Pointcut( "bean(*PortType)" )
public void externalWebServiceCall() {}
With this configuration I get an exception :
Caused by: org.springframework.aop.framework.AopConfigException: Could not
generate CGLIB subclass of class [class $Proxy169]: Common causes of this
problem include using a final class or a non-visible class; nested exception
is java.lang.IllegalArgumentException: Cannot subclass final class class
$Proxy169
at
org.springframework.aop.framework.Cglib2AopProxy.getProxy(Cglib2AopProxy.java:213)
at
org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:110)
>From my understanding, <jaxws:client> creates a CGLIB proxy as web service
client bean, and my AOP frameworks also tries to create one BUT the first
CGLIB class is created as FINAL.
Is there any workaround ?
Nicolas
Re: issue with and Spring-aop
Posted by nicolas de loof <ni...@gmail.com>.
Beeing Java5 Proxy as a jaxws spec requirement I'd need to use Proxy-based
AOP, but then fall into the @Resource issue I reported.
I've changed my AOP settings to use compile-time aspectJ for jaxws client
instrumentation (from callers).
2009/5/5 Daniel Kulp <dk...@apache.org>
>
> jaxws:client would generate a Java 5 proxy, not a CGLIB proxy. (that's
> kind
> of per jaxws spec) My guess is that java5 proxies are final. Can you
> set
> the aop stuff to use the java5 proxies instead of the CGLIB?
>
> Dan
>
>
> On Mon May 4 2009 9:26:53 am nicolas de loof wrote:
> > Hi guys,
> > I'm running into a CGLIB issue when trying to setup spring-aop on :
> >
> > <jaxws:client id="metierServicePortType"
> > serviceClass="....MetierServicePortType"
> > address="${metierService.url}">
> > </jaxws:client>
> >
> > My monitoring framework uses spring-AOP (ApscetJ syntax) to instrument
> > beans
> >
> >
> > @Around( "SystemArchitecture.externalWebServiceCall()" )
> > public Object log( ProceedingJoinPoint jp ) { ... }
> >
> > @Pointcut( "bean(*PortType)" )
> > public void externalWebServiceCall() {}
> >
> > With this configuration I get an exception :
> >
> > Caused by: org.springframework.aop.framework.AopConfigException: Could
> not
> > generate CGLIB subclass of class [class $Proxy169]: Common causes of this
> > problem include using a final class or a non-visible class; nested
> > exception is java.lang.IllegalArgumentException: Cannot subclass final
> > class class $Proxy169
> > at
> >
> org.springframework.aop.framework.Cglib2AopProxy.getProxy(Cglib2AopProxy.ja
> >va:213) at
> >
> org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:1
> >10)
> >
> > From my understanding, <jaxws:client> creates a CGLIB proxy as web
> service
> > client bean, and my AOP frameworks also tries to create one BUT the first
> > CGLIB class is created as FINAL.
> > Is there any workaround ?
> >
> > Nicolas
>
> --
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
>
Re: issue with and Spring-aop
Posted by Daniel Kulp <dk...@apache.org>.
jaxws:client would generate a Java 5 proxy, not a CGLIB proxy. (that's kind
of per jaxws spec) My guess is that java5 proxies are final. Can you set
the aop stuff to use the java5 proxies instead of the CGLIB?
Dan
On Mon May 4 2009 9:26:53 am nicolas de loof wrote:
> Hi guys,
> I'm running into a CGLIB issue when trying to setup spring-aop on :
>
> <jaxws:client id="metierServicePortType"
> serviceClass="....MetierServicePortType"
> address="${metierService.url}">
> </jaxws:client>
>
> My monitoring framework uses spring-AOP (ApscetJ syntax) to instrument
> beans
>
>
> @Around( "SystemArchitecture.externalWebServiceCall()" )
> public Object log( ProceedingJoinPoint jp ) { ... }
>
> @Pointcut( "bean(*PortType)" )
> public void externalWebServiceCall() {}
>
> With this configuration I get an exception :
>
> Caused by: org.springframework.aop.framework.AopConfigException: Could not
> generate CGLIB subclass of class [class $Proxy169]: Common causes of this
> problem include using a final class or a non-visible class; nested
> exception is java.lang.IllegalArgumentException: Cannot subclass final
> class class $Proxy169
> at
> org.springframework.aop.framework.Cglib2AopProxy.getProxy(Cglib2AopProxy.ja
>va:213) at
> org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:1
>10)
>
> From my understanding, <jaxws:client> creates a CGLIB proxy as web service
> client bean, and my AOP frameworks also tries to create one BUT the first
> CGLIB class is created as FINAL.
> Is there any workaround ?
>
> Nicolas
--
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog