If I comment out the jaxrs:client, then there are no issues.. I have a jaxrs:server defined with no issues. I also have a jaxws:client defined with no issues.
The issue is with the jaxrs:client.. Even if I do not use it anywhere in the code... and just have it defined (whether it be defined in the jbossws-cxf.xml config file or a spring config file), it throws that exception as soon as I define an advice like @Before. I can have a class with the @Aspect and @Component annotations. That class can have the AuditInterface auditClient in it. That class can even have pointcuts defined.. Everything is fine up to that point. But the second I define and advice (ie.. like @Before), whether I define it in xml schema or via annotations, then the jaxrs:client throws exceptions. I am starting to believe that this is a bug. I have tried many combinations (xml config, annotation, moving around jaxrs:client definintion, not including it in aspect class, etc.. and nothing is working). I did have success though, if I create the jaxrs:client programmatically.. via the JAXRSClientFactory.create(getAuditUri(), AuditInterface.class) I put this in an AfterPropertiesSet(), and it worked. The only issue now is that @Before advice works, but @AfterReturning and @AfterThrowing now do not. Very odd.. But, we should be able to define this in the config, and not be limited to the programmatic approach. On Tue, Mar 29, 2011 at 4:56 AM, Sergey Beryozkin <[email protected]> wrote: > Redirecting to the users list... > > ---------- Forwarded message ---------- > From: Sergey Beryozkin <[email protected]> > Date: Tue, Mar 29, 2011 at 9:54 AM > Subject: Re: cxf jaxrs:client and aop > To: [email protected] > > > Hi > > The config is not visible. What happens if you comment out a jaxrs:client > altogether, just wondering, has it something to do with the jaxrs:client > proxy being AOP-ed or not... > > thanks, Sergey > > On Tue, Mar 29, 2011 at 5:08 AM, brianmoss1003 <[email protected]> > wrote: >> >> Not sure if there is a bug or if I am not doing something correct. >> I have defined a jaxrs:client in my jbossws-cxf.xml file as follows: >> >> >> >> >> >> >> In my spring config file, I have defined an aspect bean called: AuditImpl >> >> >> >> >> This extends an interface called: Audit >> I have the auditClient as a property and within the AuditImpl, I define >> the >> auditClient as: >> >> private AuditInterface auditClient; >> public void setAuditClient(AuditInterface auditClient) { >> this.auditClient = auditClient; >> } >> >> >> I can define the aspect, via xml schema config, or through annotations >> fine.. It will build and deploy to jboss fine. As soon as I define >> @Before, it does not deploy any more. Whether I define the Before in the >> xml schema or as an annotation, the defining of it kills the deployment. >> >> Any help is appreciated. Is this a bug or am I doing something wrong? If >> I >> am doing something wrong, can you please provide some help as to what? >> Thank you. >> >> I get the following error: >> >> org.springframework.beans.factory.BeanCreationException: Error creating >> bean >> with name 'auditClient': Initialization of bean failed; nested exception >> is >> org.aspectj.weaver.reflect.ReflectionWorld$ReflectionWorldException: >> warning >> can't determine superclass of missing type $Proxy388 >> [Xlint:cantFindType] >> at >> >> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527) >> at >> >> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) >> at >> >> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) >> at >> >> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) >> at >> >> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) >> at >> >> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) >> at >> >> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580) >> at >> >> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) >> at >> >> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) >> at >> >> org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276) >> at >> >> org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197) >> at >> >> org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47) >> at >> >> org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3910) >> at >> org.apache.catalina.core.StandardContext.start(StandardContext.java:4393) >> at >> >> org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310) >> at >> >> org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142) >> at >> >> org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461) >> at >> org.jboss.web.deployers.WebModule.startModule(WebModule.java:118) >> at org.jboss.web.deployers.WebModule.start(WebModule.java:97)...... >> (more) >> >> >> -- >> View this message in context: >> http://cxf.547215.n5.nabble.com/cxf-jaxrs-client-and-aop-tp4268741p4268741.html >> Sent from the cxf-issues mailing list archive at Nabble.com. > > > > > > > -- > Sergey Beryozkin > > Application Integration Division of Talend > http://sberyozkin.blogspot.com > -- "Carpe Diem" Brian Moss
