Hi guys,

  I'm trying to figure out a pretty frustrating problem I'm having with the
2.1-dev branch of xmlrpc. I have some simple code in a server component
exposed through the XmlRpc WebServer class that does an ingest of a file and
some metadata into an underlying catalog. The code looks something to the
effect of:

public class MyServer{

  public MyServer(int port){
    fWebServerPort = port;

        // start up the web server
        fWebServer = new WebServer(fWebServerPort);
        fWebServer.addHandler("filemgr", this);
        fWebServer.start();
   }

public synchronized String ingestProduct(params...){
     //add catalog data
     //transfer file
    return fileId;
}

}

In my client application, I call the ingestMethod, and I am noticing under
some light stress (e.g., most likely between 30-40 communications,
potentially simultaneous), that my MyServer class fails to respond to the
client's invocation of it. My Client class looks like:

public class MyClient{
    public XmlRpcClient fClient = null;

  public MyClient(URL serverUrl){
   //init fClient to point to the XmlRpcServer
    fClient = new XmlRpcClient(new URL(serverUrl));
  }

   public String ingestCall(params...){
      String productId = nulll;
     Vector argList = new Vector();
      argList.addAll(params);
       try {
           productId = (String)fClient.execute("filemgr.ingestProduct",
                   argList);
       } catch (XmlRpcException e) {
           e.printStackTrace();
           throw new Exception(e.getMessage());
       } catch (IOException e) {
               e.printStackTrace();
           throw new Exception(e.getMessage());
       }  
}

}

The exception that is being thrown is the IOException, and it throws back:

java.lang.Exception: Read timed out

It throws back the regular Exception because I wrapped the IOException in
the regular exception class. In any case, the method call to fClient.execute
never returns and an exception is thrown. I've racked my brain trying to
figure out why this happens. The weirder thing is, if I run the client and
the server on the same machine, the error goes away. It's when I distribute
the client and server to different machines that this error springs up.
Could anyone suggest why this is happening, and furthermore, are there any
ways to potentially fix this problem? I seem to only experience it under
heavy stress to the Server class. Any help would be greatly appreciated.

Thanks!

Cheers,
  Chris
     


Reply via email to