Return-Path: Delivered-To: apmail-cxf-users-archive@www.apache.org Received: (qmail 68256 invoked from network); 19 Jan 2010 14:31:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 19 Jan 2010 14:31:00 -0000 Received: (qmail 28070 invoked by uid 500); 19 Jan 2010 14:30:59 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 27991 invoked by uid 500); 19 Jan 2010 14:30:59 -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 27981 invoked by uid 99); 19 Jan 2010 14:30:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Jan 2010 14:30:59 +0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=SPF_PASS,STOX_REPLY_TYPE,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [131.239.30.132] (HELO ntmamx2.progress.com) (131.239.30.132) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Jan 2010 14:30:51 +0000 Received: from ntmamx2.progress.com (127.0.0.1) by ntmamx2.progress.com (MlfMTA v3.2r9) id han11o0171sf for ; Tue, 19 Jan 2010 09:30:29 -0500 (envelope-from ) Received: from progress.com ([172.16.3.168]) by ntmamx2.progress.com (SonicWALL 7.1.1.1995) with ESMTP; Tue, 19 Jan 2010 09:30:29 -0500 Received: from NTMAEXCAS02.bedford.progress.com (ntmaexcas02 [10.128.13.36]) by progress.com (8.13.8/8.13.8) with ESMTP id o0JEUROH007405 for ; Tue, 19 Jan 2010 09:30:27 -0500 (EST) Received: from sberyoz (10.5.2.31) by NTMAEXCAS02.bedford.progress.com (10.128.13.37) with Microsoft SMTP Server (TLS) id 8.2.213.0; Tue, 19 Jan 2010 09:30:26 -0500 Message-ID: <019e01ca9913$f18cdf10$1f02050a@emea.progress.com> From: Sergey Beryozkin To: References: <27223821.post@talk.nabble.com> Subject: Re: CXF, osgi and tomcat problem Date: Tue, 19 Jan 2010 14:30:24 +0000 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3598 x-mimeole: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Mlf-Version: 7.1.1.1995 X-Mlf-UniqueId: o201001191430290493015 Hi > > Hello, > > I am newbie for CXF. I am using CXF, osgi (equinox), tomcat configuration > for testing. My motto to expose restful web services with tomcat in osgi > enviroment. > > I succeeded in exposing CXF in tomcat without OSGI. For this I forwarded all > the request to CXFServlet with some of spring configuration. > > > Now I try to use tomcat and osgi environement. I am using servletbrigge.jar > for tomcat configuration. > > My understanding is... request should come to websevice should first > redirect to servlet bridge. From here it should go to CXFServlet. > > Now I should expose any endpoint, This endpoint will be called by CXFServlet > without jetty and with tomcat. > > Now my problem is: I read the CXF document and how to publish endpoint. for > this I am using code snippet: > > JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean(); > sf.setResourceClasses(CustomerService.class); > sf.setResourceProvider(CustomerService.class, new > SingletonResourceProvider(new CustomerService())); > sf.setAddress("http://localhost:9000/"); > sf.create(); > > When I give the address "http://localhost:9000", it is invoking jetty. how > to avoid jetty invocation and use tomcat configuration? > > Is it possible to solve this by any configuration, please advice me or any > code snippet will help me a lot. Have a look please here : http://svn.apache.org/repos/asf/cxf/dosgi/tags/cxf-dosgi-ri-1.1/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSHttpServiceConfigurationTypeHandler.java check createServer(...), you probably will need to do something similar, in the simplest case : CXFNonSpringServlet cxf = new CXFNonSpringServlet(); HttpService httpService = getHttpService(); httpService.registerServlet(contextRoot, cxf, new Hashtable(), null); Bus bus = cxf.getBus(); JAXRSServerFactoryBean factory = new JAXRSServerFactoryBean(); factory.setBus(bus); factory.setServiceClass(iClass); factory.setResourceProvider(iClass, new SingletonResourceProvider(serviceBean)); factory.setAddress("/"); // get custom providers (if any) and register them // factory.setProviders(providers); factory.create();> > Another problem: I also tried it with DOSGI. The problem with DOSGI is, I > can't get Grammer tag and not able to generate stubs. If any body can > suggest me how to overcome both the problem for DOSGI, I can take this > solution and start working on this. Can you explain a bit more ? Which stubs ? cheers, Sergey > -- > View this message in context: http://old.nabble.com/CXF%2C-osgi-and-tomcat-problem-tp27223821p27223821.html > Sent from the cxf-user mailing list archive at Nabble.com. >