Return-Path: X-Original-To: apmail-cxf-dev-archive@www.apache.org Delivered-To: apmail-cxf-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 37BF71735E for ; Thu, 26 Feb 2015 12:53:28 +0000 (UTC) Received: (qmail 72089 invoked by uid 500); 26 Feb 2015 12:53:28 -0000 Delivered-To: apmail-cxf-dev-archive@cxf.apache.org Received: (qmail 72042 invoked by uid 500); 26 Feb 2015 12:53:27 -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 72030 invoked by uid 99); 26 Feb 2015 12:53:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Feb 2015 12:53:27 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mikewse@hotmail.com designates 157.55.2.95 as permitted sender) Received: from [157.55.2.95] (HELO DUB004-OMC4S20.hotmail.com) (157.55.2.95) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Feb 2015 12:53:21 +0000 Received: from DUB128-DS5 ([157.55.2.73]) by DUB004-OMC4S20.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.22751); Thu, 26 Feb 2015 04:52:59 -0800 X-TMN: [MDEjUP9dYvueucpZJK/NVPnbtLGag+xO] X-Originating-Email: [mikewse@hotmail.com] Message-ID: From: Mike Wilson To: References: <54EC5140.8060201@gmail.com> <54ECAF49.60503@gmail.com> In-Reply-To: <54ECAF49.60503@gmail.com> Subject: RE: avoid using contextClassLoader inside OSGi? Date: Thu, 26 Feb 2015 13:52:56 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 Thread-Index: AdBQVB5TsWsiGkPFSMCOCFwDKf76pABbamRw X-MimeOLE: Produced By Microsoft MimeOLE V6.1.7601.17609 X-OriginalArrivalTime: 26 Feb 2015 12:52:59.0380 (UTC) FILETIME=[261F4340:01D051C3] X-Virus-Checked: Checked by ClamAV on apache.org [sorry about the delay] Sergey Beryozkin wrote: > Hi > > > On 24/02/15 14:46, Mike Wilson wrote: > > Yes, the undesired side-effect for us is that the > combination of CXF, Juli > > and Pax Logging breaks down. Looking at the code it seems > all involved > > parties have design decisions done with good intentions and the only > > questionable thing is CXF's use of TCCL, which is sort of > the trigger of the > > problem. So I thought this would be the first thing worth > considering as it > > is advised against in OSGi. > > > > If not possible to remove TCCL entirely, then it might > still be possible to > > only set it during the very calls into stuff that need it, > instead of during > > the whole message cycle? > > Can you please describe in more details where setting TCCL in > CXF causes > issues with this particular combination ? Or is the problem > across CXF ? > I guess a single example would do for us to see if it is. > > Are you referring to > > public ChainInitiationObserver(Endpoint endpoint, Bus bus) { > super(); > this.endpoint = endpoint; > this.bus = bus; > if (bus != null) { > loader = bus.getExtension(ClassLoader.class); > } > } > > and then this loader, if not null, is set as TCCL ? > > I've just tun a non OSGI test, it is null... > > Cheers, Sergey Yes, this is the place. The loader gets configured with a org.apache.cxf.bus.blueprint.BundleDelegatingClassLoader when run under OSGi. Btw, my impression is that this class isn't providing much added functionality so maybe it could be removed or refactored. Best regards Mike