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 CD8EC19574 for ; Tue, 12 Apr 2016 11:31:04 +0000 (UTC) Received: (qmail 57995 invoked by uid 500); 12 Apr 2016 11:31:04 -0000 Delivered-To: apmail-cxf-dev-archive@cxf.apache.org Received: (qmail 57926 invoked by uid 500); 12 Apr 2016 11:31:04 -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 57913 invoked by uid 99); 12 Apr 2016 11:31:04 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Apr 2016 11:31:04 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C1C92DFC74; Tue, 12 Apr 2016 11:31:03 +0000 (UTC) From: neykov To: dev@cxf.apache.org Reply-To: dev@cxf.apache.org Message-ID: Subject: [GitHub] cxf pull request: Fixes a NPE if Bus is not registered Content-Type: text/plain Date: Tue, 12 Apr 2016 11:31:03 +0000 (UTC) GitHub user neykov opened a pull request: https://github.com/apache/cxf/pull/129 Fixes a NPE if Bus is not registered Just adding the bundle in an OSGi container causes a NPE in the logs because the Activator is called, but no Bus service is available. Even if there's a bundle providing the Bus service it could be registered after the asyncclient Activator executes so the `HTTPConduitFactory` service will be registered indeterministically. The changes will wait for the Bus service to become available and register the `HTTPConduitFactory` service. Here's the stack trace of the exception: ``` 2016-03-09 18:41:49,298 | ERROR | ort.http.async]) | configadmin | 3 - org.apache.felix.configadmin - 1.8.8 | [org.osgi.service.cm.ManagedService, id=146, bundle=84/mvn:org.apache.cxf/cxf-rt-transports-http-hc/3.1.4]: Unexpected problem updating configuration org.apache.cxf.transport.http.async java.lang.NullPointerException at org.apache.cxf.transport.http.asyncclient.AsyncHTTPConduitFactory.addListener(AsyncHTTPConduitFactory.java:285)[84:org.apache.cxf.cxf-rt-transports-http-hc:3.1.4] at org.apache.cxf.transport.http.asyncclient.AsyncHTTPConduitFactory.(AsyncHTTPConduitFactory.java:144)[84:org.apache.cxf.cxf-rt-transports-http-hc:3.1.4] at org.apache.cxf.transport.http.asyncclient.Activator$ConduitConfigurer.updated(Activator.java:79)[84:org.apache.cxf.cxf-rt-transports-http-hc:3.1.4] at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189)[3:org.apache.felix.configadmin:1.8.8] at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152)[3:org.apache.felix.configadmin:1.8.8] at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85)[3:org.apache.felix.configadmin:1.8.8] at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1444)[3:org.apache.felix.configadmin:1.8.8] at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1400)[3:org.apache.felix.configadmin:1.8.8] at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:143)[3:org.apache.felix.configadmin:1.8.8] at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:110)[3:org.apache.felix.configadmin:1.8.8] at java.lang.Thread.run(Thread.java:745)[:1.7.0_80] ``` You can merge this pull request into a Git repository by running: $ git pull https://github.com/neykov/cxf fix/missing-bus Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cxf/pull/129.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #129 ---- commit 17e05cde74aa6639cb2d2b5d811668d941fbafb4 Author: Svetoslav Neykov Date: 2016-04-12T11:29:11Z Fixes a NPE if Bus is not registered Just adding the bundle in an OSGi container causes a NPE in the logs because the Activator is called, but no Bus service is available. Even if there's a bundle providing the Bus service it could be registered after the asyncclient Activator executes so the HTTPConduitFactory service will be registered indeterministically. The changes will wait for the Bus service to become available and register the HTTPConduitFactory service. ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---