You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "David Liu (JIRA)" <ji...@apache.org> on 2011/03/29 08:45:06 UTC

[jira] [Updated] (CXF-3429) ServerImpl should shutdown Destination before setMessageObserver=null

     [ https://issues.apache.org/jira/browse/CXF-3429?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Liu updated CXF-3429:
---------------------------

    Description: 
Hi,

  During shutdown the CXF server, we encounter the NullPointerException from time to time. 
  The issue is that ServerImpl will set MessageObserver to null, and then it shutdown desination. however, if the server is multi-thread and probably some thread is runing, then it can result in NullPointerException because MessageObserver is null.

  Can we fix this bug by shutdown the Destination first and then set MessageObserver to null?
  
  Also, do we have a workaround for this issue?

{code}
public class ServerImpl implements Server {
public void stop() {
    LOG.fine("Server is stopping.");
    ...
    getDestination().setMessageObserver(null);
    getDestination().shutdown();
}
{code}

David

  was:
Hi,

  During shutdown the CXF server, we encounter the NullPointerException from time to time. 
  The issue is that ServerImpl will set MessageObserver to null, and then it shutdown desination. however, if the server is multi-thread and probably some thread is runing, then it can result in NullPointerException because MessageObserver is null.

  Can we fix this bug by shutdown the Destination first and then set MessageObserver to null?

{code}
public class ServerImpl implements Server {
public void stop() {
    LOG.fine("Server is stopping.");
    ...
    getDestination().setMessageObserver(null);
    getDestination().shutdown();
}
{code}

David


> ServerImpl should shutdown Destination before setMessageObserver=null
> ---------------------------------------------------------------------
>
>                 Key: CXF-3429
>                 URL: https://issues.apache.org/jira/browse/CXF-3429
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.2.10
>            Reporter: David Liu
>
> Hi,
>   During shutdown the CXF server, we encounter the NullPointerException from time to time. 
>   The issue is that ServerImpl will set MessageObserver to null, and then it shutdown desination. however, if the server is multi-thread and probably some thread is runing, then it can result in NullPointerException because MessageObserver is null.
>   Can we fix this bug by shutdown the Destination first and then set MessageObserver to null?
>   
>   Also, do we have a workaround for this issue?
> {code}
> public class ServerImpl implements Server {
> public void stop() {
>     LOG.fine("Server is stopping.");
>     ...
>     getDestination().setMessageObserver(null);
>     getDestination().shutdown();
> }
> {code}
> David

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira