Return-Path: Delivered-To: apmail-cxf-users-archive@www.apache.org Received: (qmail 77339 invoked from network); 13 Nov 2009 18:01:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 Nov 2009 18:01:12 -0000 Received: (qmail 96916 invoked by uid 500); 13 Nov 2009 18:01:12 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 96865 invoked by uid 500); 13 Nov 2009 18:01:11 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 96855 invoked by uid 99); 13 Nov 2009 18:01:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Nov 2009 18:01:11 +0000 X-ASF-Spam-Status: No, hits=-10.2 required=5.0 tests=AWL,BAYES_00,HABEAS_ACCREDITED_SOI,HTML_MESSAGE,RCVD_IN_BSP_TRUSTED,RCVD_IN_DNSWL_MED X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [216.33.244.6] (HELO rhv-mipot-001.corp.ebay.com) (216.33.244.6) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Nov 2009 18:01:08 +0000 X-EBay-Corp: Yes X-IronPort-AV: E=Sophos;i="4.44,738,1249282800"; d="scan'208,217";a="49554278" Received: from rhv-vtenf-002.corp.ebay.com (HELO RHV-MEXBH-001.corp.ebay.com) ([10.112.113.53]) by rhv-mipot-001.corp.ebay.com with ESMTP; 13 Nov 2009 10:00:47 -0800 Received: from RHV-EXM-04.corp.ebay.com ([10.245.17.53]) by RHV-MEXBH-001.corp.ebay.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 13 Nov 2009 09:59:59 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01CA648B.1D6608D9" Subject: RE: CXF and Custom Annotation Date: Fri, 13 Nov 2009 09:59:58 -0800 Message-ID: <2BC75D6D6FD0E342952A22AAA39C65060654AB12@RHV-EXM-04.corp.ebay.com> In-Reply-To: <00a801ca62b5$bb9ad6d0$1f02050a@emea.progress.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: CXF and Custom Annotation Thread-Index: AcpitcfSgUGLYF5wRKy2Hd1E6IFhWgB1T7CQ References: <2BC75D6D6FD0E342952A22AAA39C6506064A3589@RHV-EXM-04.corp.ebay.com> <00a801ca62b5$bb9ad6d0$1f02050a@emea.progress.com> From: "Pydipati, Karuna" To: "Sergey Beryozkin" , , "Sergey Beryozkin" X-OriginalArrivalTime: 13 Nov 2009 17:59:59.0233 (UTC) FILETIME=[1D8A8710:01CA648B] X-CFilter: Scanned ------_=_NextPart_001_01CA648B.1D6608D9 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks. I added the following improvement issue. =20 https://issues.apache.org/jira/browse/CXF-2534 =20 Regards Karuna Pydipati StubHub/eBay - Platform & Services Phone: (415)222-8752 Email: kpydipati@ebay.com =20 =20 =20 ________________________________ From: Sergey Beryozkin [mailto:sberyozk@progress.com]=20 Sent: Wednesday, November 11, 2009 2:00 AM To: Pydipati, Karuna; users@cxf.apache.org; Sergey Beryozkin Subject: Re: CXF and Custom Annotation Hi =20 > This is because ResourceInjector (CXF class) works on Fields (using Reflections API) rather than on methods. =20 Perhaps it is worth opening an enhancement request against JAXWS runtime ? In meantime, any chnace that you can force Sprion AOP to use CGLIB ? It might help. =20 > I might need to do some other way of doing Throttling in stead of using Custom annotations. =20 You can probably register a custom input CXF interceptor and configure it with the names of the methods to be throttled but I'm not right now how to get the name of the method to be invoked from the Message. Another option is to register a custom JAXWS invoker (configured with the names) and check the Method there =20 cheers, Sergey ----- Original Message -----=20 From: Pydipati, Karuna =20 To: users@cxf.apache.org ; Sergey Beryozkin ; Sergey Beryozkin =20 Sent: Tuesday, November 10, 2009 11:20 PM Subject: RE: CXF and Custom Annotation =09 =09 I kind of found the issue. Since, I am doing my own Spring-AOP, I need to modify the jaxws:endpoint XML config as follows. =20 =20 Because of this, since Spring works on proxies, somehow, @Resource (WebServiceContext ) is failing. This is because ResourceInjector (CXF class) works on Fields (using Reflections API) rather than on methods. If the accessing of WebServiceContext is done using Methods (Reflections API), it would not be a problem because proxies have methods too. =20 So it appears that, we can not have any custom annotations in CXF implementor classes. I see this is a limitation of CXF (at least for now). I might need to do some other way of doing Throttling in stead of using Custom annotations. =20 Has anybody done any custom annotations on CXF implementor class which have @Resource (WebServiceContext)? =20 Regards Karuna Pydipati StubHub/eBay - Platform & Services Phone: (415)222-8752 Email: kpydipati@ebay.com =20 =20 =20 ________________________________ From: Pydipati, Karuna=20 Sent: Monday, November 09, 2009 3:49 PM To: users@cxf.apache.org; 'Sergey Beryozkin'; Sergey Beryozkin Subject: CXF and Custom Annotation =09 =09 Hi =20 I have a weird issue. I have a JAX-WS java-first webservice using CXF and Spring. I have WebServiceContext in my Implementer class. Here is snippet of my Implementer class =20 @WebService(endpointInterface =3D "com.xxx.ws.soap.XXXService", serviceName =3D "XXXService") @WebFault(targetNamespace =3D "com.xxx.ws.soap", name =3D "XXXFault", faultBean =3D "XXXFault") public class XXXServiceImpl implements XXXService { =20 @Resource private WebServiceContext webServiceContext; =20 @Throttle public PatientMatchResp getSomeMethod() throws ApplicationFault { .... .... .... } =09 I have a custom annotation @Throttle and would like to do some work (basically throttling the method such as way that this service is not abused by users when exposed to public) on that method using Spring AOP.=20 =20 1) My issue is when I started my Tomcat with this implementation, I am getting this error. Again, this is at the startup time of Tomcat time. Not at some invocation of webservice time. If I comment either WebServiceContext OR @Throttle, then, things are OK. Why is my custom annotation is giving problem for CXF startup? =20 2) Second questions is.. is there a easy way to get hold of HttpServletRequest into my Aspect (Spring AOP). I don't know whether this is a right forum or not. Currently, I am trying to get hold of WebServiceContext using reflections API in my Aspect class and trying to get HttpServletRequest. Is there an example where I can write a CXF Handler/Filter and put WebServiceContext into ThreadLocal so that I can get it wherever I want down-the-line(here..in this case my Aspect class)?=20 =20 Caused by: javax.xml.ws.WebServiceException: Creation of Endpoint failed at org.apache.cxf.jaxws.JaxWsServerFactoryBean.init(JaxWsServerFactoryBean. java:181) at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBea n.java:168) at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:346) at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:259) at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:209) at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:404) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac tory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1413 ) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac tory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1374) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac tory.initializeBean(AbstractAutowireCapableBeanFactory.java:1334) ... 39 more Caused by: java.lang.IllegalArgumentException at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.ja va:37) at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorI mpl.java:57) at java.lang.reflect.Field.set(Field.java:656) at org.apache.cxf.common.injection.ResourceInjector.injectField(ResourceInj ector.java:283) at org.apache.cxf.common.injection.ResourceInjector.visitField(ResourceInje ctor.java:167) at org.apache.cxf.common.annotation.AnnotationProcessor.processFields(Annot ationProcessor.java:101) at org.apache.cxf.common.annotation.AnnotationProcessor.accept(AnnotationPr ocessor.java:69) at org.apache.cxf.common.injection.ResourceInjector.inject(ResourceInjector .java:81) at org.apache.cxf.jaxws.JaxWsServerFactoryBean.injectResources(JaxWsServerF actoryBean.java:221) at org.apache.cxf.jaxws.JaxWsServerFactoryBean.init(JaxWsServerFactoryBean. java:175) ... 51 more Nov 9, 2009 3:32:14 PM org.apache.catalina.core.ApplicationContext log =09 =20 Regards Karuna Pydipati StubHub/eBay - Platform & Services Phone: (415)222-8752 Email: kpydipati@ebay.com =20 =20 =20 ------_=_NextPart_001_01CA648B.1D6608D9--