You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Gareth Reeves <re...@pobox.com> on 2002/08/15 01:11:07 UTC

Deadlock in ServerHTTPUtils

Hi

I am having a problem when I a have a RPC service call another rpc service
located on the same server. I have tracked the problem down to the piece of
code in ServerHTTPUtils (below).

I am assuming that it gets locked on the synchronized( context ) bit but not
sure why. Anyone else had this problem?

For my own sanity, I created 2 very simple services to test calling one
service from another in the same vm. This service just called a simple
method that returned a string. These services didnĀ¹t have any deadlock
issues. 

I am using Tomcat 4.0.3 and SOAP 2.3.1.

Help!!

 public static ServiceManager
getServiceManagerFromContext(ServletContext context,
                                                            String
configFilename) {
    Object o;
    if ( context != null ) {

      synchronized (context) {
        o = context.getAttribute(SERVICE_MANAGER_ID);
        if (o == null) {
          o = new ServiceManager(context, configFilename);
          context.setAttribute (SERVICE_MANAGER_ID, o);
        }
      }
    }
    else {
      o = new ServiceManager( null, configFilename );
    }
    return (ServiceManager) o;
  }

---------------------------------------------------------
Gareth Reeves -- reevesg@pobox.com
http://jstorm.sourceforge.net
"Sufficient to the day are the troubles thereof..."