Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A503D981D for ; Thu, 26 Jan 2012 16:25:02 +0000 (UTC) Received: (qmail 95594 invoked by uid 500); 26 Jan 2012 16:25:02 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 95452 invoked by uid 500); 26 Jan 2012 16:25:01 -0000 Mailing-List: contact issues-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 issues@cxf.apache.org Received: (qmail 95442 invoked by uid 99); 26 Jan 2012 16:25:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Jan 2012 16:25:01 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Jan 2012 16:24:59 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 7D6EB164566 for ; Thu, 26 Jan 2012 16:24:38 +0000 (UTC) Date: Thu, 26 Jan 2012 16:24:38 +0000 (UTC) From: "Vitaliy Garnashevich (Created) (JIRA)" To: issues@cxf.apache.org Message-ID: <1023543305.81824.1327595078515.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Created] (CXF-4066) AbstractTransportFactory registers itself as extension, before being fully initialized MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org AbstractTransportFactory registers itself as extension, before being fully initialized -------------------------------------------------------------------------------------- Key: CXF-4066 URL: https://issues.apache.org/jira/browse/CXF-4066 Project: CXF Issue Type: Bug Affects Versions: 2.5.2, 2.4.5 Reporter: Vitaliy Garnashevich AbstractTransportFactory calls register() at the end of its constructor, to register itself as a DestinationFactory and/or as a ConduitInitiator. Classes that extend AbstractTransportFactory (e.g. HTTPTransportFactory), and which call super's constructor, have no way to properly initialize, before being exposed as an extension. Such classes must call super() constructor, before initializing their fields. This could lead to concurrency issues, when such object is used as an extension, before being fully initialized. Here is a stack trace of such problem: java.lang.NullPointerException at org.apache.cxf.transport.http.HTTPTransportFactory.getDestination(HTTPTransportFactory.java:261) at org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134) at org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:93) at org.apache.cxf.endpoint.ServerImpl.(ServerImpl.java:72) at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:158) at org.apache.cxf.dosgi.dsw.handlers.PojoConfigurationTypeHandler.createServer(PojoConfigurationTypeHandler.java:143) at org.apache.cxf.dosgi.dsw.hooks.ServiceHookUtils.createServer(ServiceHookUtils.java:86) at org.apache.cxf.dosgi.dsw.hooks.CxfPublishHook.createServer(CxfPublishHook.java:106) at org.apache.cxf.dosgi.dsw.hooks.CxfPublishHook.publishEndpoint(CxfPublishHook.java:80) at org.apache.cxf.dosgi.dsw.Activator$1.run(Activator.java:164) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Here, the HTTPTransportFactory.getDestination() method, implementing DestinationFactory interface, is called before HTTPTransportFactory's "registry" field is assigned by constructor. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira