Return-Path: Delivered-To: apmail-cxf-dev-archive@www.apache.org Received: (qmail 23644 invoked from network); 22 Dec 2008 15:52:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Dec 2008 15:52:08 -0000 Received: (qmail 96228 invoked by uid 500); 22 Dec 2008 15:52:08 -0000 Delivered-To: apmail-cxf-dev-archive@cxf.apache.org Received: (qmail 96004 invoked by uid 500); 22 Dec 2008 15:52:07 -0000 Mailing-List: contact dev-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list dev@cxf.apache.org Received: (qmail 95993 invoked by uid 99); 22 Dec 2008 15:52:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Dec 2008 07:52:07 -0800 X-ASF-Spam-Status: No, hits=-4.0 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of Gary.Tong@morganstanley.com designates 205.228.53.68 as permitted sender) Received: from [205.228.53.68] (HELO hqmtaint01.ms.com) (205.228.53.68) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Dec 2008 15:51:58 +0000 Received: from hqmtaint01 (localhost.ms.com [127.0.0.1]) by hqmtaint01.ms.com (output Postfix) with ESMTP id 8564988C4DD for ; Mon, 22 Dec 2008 10:51:37 -0500 (EST) Received: from ny0032as01 (unknown [144.203.194.95]) by hqmtaint01.ms.com (internal Postfix) with ESMTP id 6E4B7B00030 for ; Mon, 22 Dec 2008 10:51:37 -0500 (EST) Received: from ny0032as01 (localhost [127.0.0.1]) by ny0032as01 (msa-out Postfix) with ESMTP id 55911C9422E for ; Mon, 22 Dec 2008 10:51:37 -0500 (EST) Received: from PIWEXOB02.msad.ms.com (piwexob02 [205.228.46.104]) by ny0032as01 (mta-in Postfix) with ESMTP id 5282A16402F for ; Mon, 22 Dec 2008 10:51:37 -0500 (EST) Received: from piexcat01.msad.ms.com ([10.163.2.210]) by PIWEXOB02.msad.ms.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 22 Dec 2008 10:51:37 -0500 Received: from OZWEXHUB01.msad.ms.com (10.174.147.76) by piexcat01.msad.ms.com (10.163.2.210) with Microsoft SMTP Server (TLS) id 8.1.291.1; Mon, 22 Dec 2008 10:51:35 -0500 Received: from LNWEXMBX0144.msad.ms.com ([10.174.172.43]) by OZWEXHUB01.msad.ms.com ([10.174.147.76]) with mapi; Mon, 22 Dec 2008 15:51:28 +0000 From: "Tong, Gary \(FID\)" To: Date: Mon, 22 Dec 2008 15:51:27 +0000 Content-Transfer-Encoding: 7bit Subject: Issue with multiple CXF servlets (and proposed fix) Thread-Topic: Issue with multiple CXF servlets (and proposed fix) Thread-Index: AclkTSY/53GSPFknTjePO6PuECUSMA== Message-ID: Accept-Language: en-US Content-class: urn:content-classes:message X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.3168 Importance: normal Priority: normal Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: multipart/mixed; boundary="_002_D33A5FB583A9F843BB5A128BE3FD457E90ED37A191LNWEXMBX0144m_" MIME-Version: 1.0 X-OriginalArrivalTime: 22 Dec 2008 15:51:37.0237 (UTC) FILETIME=[2C20B450:01C9644D] X-Anti-Virus: Kaspersky Anti-Virus for MailServers 5.5.35/RELEASE, bases: 22122008 #1341906, status: clean X-Virus-Checked: Checked by ClamAV on apache.org --_002_D33A5FB583A9F843BB5A128BE3FD457E90ED37A191LNWEXMBX0144m_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello, I'm having issues with creating multiple CXFServlets. I'm trying to = insantiate 2 independent CXF servlets and deploy them at different URLs. = The relevant part of the web.xml looks like: test = org.apache.cxf.transport.servlet.CXFServlet 1 config-location /WEB-INF/test-servlet.xml test /t/* foo = org.apache.cxf.transport.servlet.CXFServlet 1 config-location /WEB-INF/foo-servlet.xml foo /f/* This, unfortunately, doesn't work. My test-servlet.xml file looks like: And foo-servlet.xml looks much the same. This configuration gives me a = "No service was found." response. However, if I move the import = statements to the base spring application context, both the test and foo = servlets end up serving up test-servlet.xml and foo-servlet.xml gets = ignored. As far as I can tell, this problem occurs because the configs specified = in config-location aren't loaded until the majority of the servlet has = been initialized. Because of this, most of the settings in = test-servlet.xml and foo-servlet.xml are ignored during initialization. The order of initialization in CXFServlet seems to be: 1. Find the spring app context. 2. Create a new bus based on the app context. 3. Set up the servlet transport factory 4. Create the controller 5. Load the additional configuration from the config-location servlet = param My proposed fix is to change the order of initialization to: 1. Find the spring app context. 2. Load the additional configuration from the config-location servlet = param 3. Create a new bus based on the new child context (or original spring = app context if there is no additional configuration) 4. Set up the servlet transport factory 5. Create the controller The attached diff does this and fixes the problem that I have with = creating two CXFServlets. Hopefully this is the right way to do this. Thanks, Gary -------------------------------------------------------- This is not an offer (or solicitation of an offer) to buy/sell the = securities/instruments mentioned or an official confirmation. Morgan = Stanley may deal as principal in or own or act as market maker for = securities/instruments mentioned or may advise the issuers. This is not = research and is not from MS Research but it may refer to a research = analyst/research report. Unless indicated, these views are the author's = and may differ from those of Morgan Stanley research or others in the = Firm. We do not represent this is accurate or complete and we may not = update this. Past performance is not indicative of future returns. For = additional information, research reports and important disclosures, = contact me or see https://secure.ms.com/servlet/cls. You should not use = e-mail to request, authorize or effect the purchase or sale of any = security or instrument, to send transfer instructions, or to effect any = other transactions. We cannot guarantee that any such requests received = via e-mail will be processed in a timely manner. This communication is = solely for the addressee(s) and may contain confidential information. = We do not waive confidentiality by mistransmission. Contact me if you = do not wish to receive these communications. In the UK, this = communication is directed in the UK to those persons who are = professional and eligible counterparties (as defined in the UK Financial = Services Authority's rules). --_002_D33A5FB583A9F843BB5A128BE3FD457E90ED37A191LNWEXMBX0144m_--