Return-Path: X-Original-To: apmail-cxf-users-archive@www.apache.org Delivered-To: apmail-cxf-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9DDB410EAB for ; Fri, 29 Nov 2013 13:46:59 +0000 (UTC) Received: (qmail 2933 invoked by uid 500); 29 Nov 2013 13:46:26 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 2852 invoked by uid 500); 29 Nov 2013 13:46:15 -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 2829 invoked by uid 99); 29 Nov 2013 13:46:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Nov 2013 13:46:14 +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 (nike.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [212.50.160.34] (HELO smtpout.karoo.kcom.com) (212.50.160.34) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Nov 2013 13:46:06 +0000 X-IronPort-AV: E=Sophos;i="4.93,798,1378854000"; d="scan'208";a="45242620" Received: from unknown (HELO tardis.spudsoft) ([91.84.217.110]) by smtpout.karoo.kcom.com with ESMTP; 29 Nov 2013 13:45:46 +0000 Received: from slave.spudsoft ([192.168.1.198]) by tardis.spudsoft with esmtpsa (TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.80.1) (envelope-from ) id 1VmOO9-0004JL-80 for users@cxf.apache.org; Fri, 29 Nov 2013 13:45:45 +0000 Message-ID: <52989A80.4090103@spudsoft.co.uk> Date: Fri, 29 Nov 2013 13:45:36 +0000 From: Jim Talbut User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: users@cxf.apache.org Subject: Re: Exception when using two separate Spring contexts both using Jackson References: <52985892.1010804@spudsoft.co.uk> <529872B7.20703@spudsoft.co.uk> <52987699.6040108@gmail.com> In-Reply-To: <52987699.6040108@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On 29/11/2013 11:12, Sergey Beryozkin wrote: > Hi Jim, > > Thanks for the update, > > I was concerned about > > >> java.lang.NullPointerException: null > >> at > >> > org.apache.cxf.jaxrs.impl.tl.ThreadLocalProviders.getContextResolver(ThreadLocalProviders.java:50) > > > should we still investigate it ? I'm just not exactly sure how a thread > local cache can be affected such that NPE is thrown, even though there > were issues with Bus references before your fix. > > May the following sequence can explain: the thread creates a context, > two tests are started, the thread finishes one test, clears a context, > and now finishes the 2nd test, but the context has gone. This can > explain it. If you think it does not then please create a test project > for me to investigate it further > > Thanks, Sergey > It has to be something like that, but I'm not sure what Spring/JUnit/CXF would have cleared. The other thing that still confuses me is that I would have expected the BusFactory.setDefault to affect things on the thread on which it is run, but the exception comes from the server thread (which should have an independent bus). Anyway, I'm happy that the fix works and, whilst I think it would be good for you to document any limitation here, I can't quite think how you could have done that in a way that I would have found - so the existence of this email thread is probably as good as anything. If I get the chance I will produce a test case, but it's not a priority. Thanks. Jim