cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vitaliy Garnashevich (Commented) (JIRA)" <>
Subject [jira] [Commented] (CXF-4066) AbstractTransportFactory registers itself as extension, before being fully initialized
Date Thu, 26 Jan 2012 16:26:38 GMT


Vitaliy Garnashevich commented on CXF-4066:

Known workaround:

For HTTPTransportFactory, we force its initialization, when bus is being initialized in our
CXFBusFactory implementation, and before anyone uses the HTTPTransportFactory:

            DestinationFactoryManager mgr = bus.getExtension(DestinationFactoryManager.class);

> AbstractTransportFactory registers itself as extension, before being fully initialized
> --------------------------------------------------------------------------------------
>                 Key: CXF-4066
>                 URL:
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.4.5, 2.5.2
>            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(
>         at org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(
>         at org.apache.cxf.endpoint.ServerImpl.initDestination(
>         at org.apache.cxf.endpoint.ServerImpl.<init>(
>         at org.apache.cxf.frontend.ServerFactoryBean.create(
>         at org.apache.cxf.dosgi.dsw.handlers.PojoConfigurationTypeHandler.createServer(
>         at org.apache.cxf.dosgi.dsw.hooks.ServiceHookUtils.createServer(
>         at org.apache.cxf.dosgi.dsw.hooks.CxfPublishHook.createServer(
>         at org.apache.cxf.dosgi.dsw.hooks.CxfPublishHook.publishEndpoint(
>         at org.apache.cxf.dosgi.dsw.Activator$
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
>         at java.util.concurrent.ThreadPoolExecutor$
>         at
> 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:!default.jspa
For more information on JIRA, see:


View raw message