title: unexpected end of file from server with rpc
body: <p>I want to write a Python client that sends an RPC to a Java server (server1) and this server send an RPC request to two other servers, one of them is in Java and it doesn't work.
  client.py:</p>
  <pre class="lang-py prettyprint-override"><code>import xmlrpc.client
      
      serverProxy = xmlrpc.client.ServerProxy(&quot;http://192.168.44.131:2161&quot;)
      ssncorrect=0
      
      while(ssncorrect==0):
          print(&quot;\n1. enter your national code  : &quot;)
          ssn = input()
          if (len(ssn)==10):
              ssncorrect=1
          
      bankAccountNumbercorrect=0
      while(bankAccountNumbercorrect==0):
          print(&quot;\n2. enter bank account number: &quot;)
          bankAccountNumber = input()
          if(len(bankAccountNumber)==8):
              bankAccountNumbercorrect=1
      serverResponse = serverProxy.twochecks.twochecks(ssn, bankAccountNumber)
      print(serverResponse)
  </code></pre>
  <p>server1.java:</p>
  <pre class="lang-java prettyprint-override"><code>import org.apache.xmlrpc.WebServer;
  import org.apache.xmlrpc.XmlRpcClient;
  import org.apache.xmlrpc.XmlRpcException;
  
  import java.io.IOException;
  import java.util.Vector;
  
  public class Server1 {
      public static int PORT = 2161;
      public static String METHOD = &quot;twochecks&quot;;
  
      public static void main(String[] args) {
          WebServer serverone = new WebServer(PORT);
          serverone.addHandler(METHOD, new Server1());
          serverone.start();
      }
  
      public static String process(
              String ssn, String deferredResponse, String ChequeResponse) {
          boolean isDeferred = deferredResponse.trim().equalsIgnoreCase(&quot;NO&quot;);
          boolean isReturned = ChequeResponse.trim().equalsIgnoreCase(&quot;NO&quot;);
          String resultMessage = &quot;&quot;;
          if (isDeferred &amp;&amp; isReturned) {
              resultMessage = &quot;CONGRATULATIONS, (&quot; + ssn + &quot;) we can pay loan to you &quot;;
          }
          if (isDeferred &amp;&amp; !isReturned) {
              resultMessage = &quot;SORRY, (&quot; + ssn + &quot;) we can not pay loan to you. because you have returned check &quot;;
          }
          if (!isDeferred &amp;&amp; isReturned) {
              resultMessage = &quot;SORRY, (&quot; + ssn + &quot;) we can not pay loan to you. because you did not pay your loan installment &quot;;
          }
          if (!isDeferred &amp;&amp; !isReturned) {
              resultMessage = &quot;SORRY, (&quot; + ssn + &quot;) we can not pay loan to you. because you have returned check and did not pay your loan installment &quot;;
          }
          return &quot;deffer status:&quot; + deferredResponse + &quot;\n\n&quot; + &quot;Returned cheque status:&quot; + &quot;   Response: &quot; + ChequeResponse + &quot;\n&quot; + &quot;  &quot; + resultMessage + &quot;\n&quot;;
  
      }
  
      public static String defHOST = &quot;192.168.44.136&quot;;
      public static int defPORT = 9518;
      public static String defMETHOD = &quot;server3.deffercheck&quot;;
      public static String defERROR = &quot;ERROR&quot;;
  
      public static String deffercheck(String ssn) {
          try {
              XmlRpcClient defercheckclient = new XmlRpcClient(defHOST, defPORT);
              Vector&lt;String&gt; defclientVector = new Vector&lt;&gt;();
              defclientVector.add(ssn);
              return (String) defercheckclient.execute(defMETHOD,defclientVector);
          } catch (IOException | XmlRpcException e) {
              System.out.println(e);
              return e.getMessage();
          }
  
  
  
      }
  
      public static String chequeHOST = &quot;192.168.44.133&quot;;
      public static int chequePORT = 1700;
      public static String chequeMETHOD = &quot;chequecheck&quot;;
      public static String chequeERROR = &quot;ERROR&quot;;
  
      public static String chequecheck(String ssn) {
  //        try {
  //            XmlRpcClient ChequeClient = new XmlRpcClient(chequeHOST, chequePORT);
  //            Vector&lt;String&gt; chequeclientVector = new Vector&lt;&gt;();
  //            chequeclientVector.add(ssn);
  //            return (String) ChequeClient.execute(chequeMETHOD, chequeclientVector);
  //        } catch (IOException | XmlRpcException e) {
  //            System.out.println(e);
  //            return chequeERROR;
  //        }
          return  &quot;no&quot;;
      }
  
      public String twochecks(String ssn, String bankAccountNumber) {
          String deferredResponse = deffercheck(ssn);
          String ChequeResponse = chequecheck(ssn);
          System.out.print(deferredResponse);
          return process(ssn, deferredResponse, ChequeResponse);
      }
  }
  </code></pre>
  <p>I commented some code to be sure it works OK.</p>
  <p>server3.java:</p>
  <pre class="lang-java prettyprint-override"><code>import java.io.File;
  import java.io.FileNotFoundException;
  import java.util.Scanner;
  import org.apache.xmlrpc.WebServer;
  
  public class server3 {
    public static final int PORT =9513 ;
    public static final String METHOD = &quot;server3&quot;;
    public static void main(String[] args) {
    WebServer loanserver = new WebServer(PORT);
    loanserver.addHandler(METHOD, new server3());
    loanserver.start();
    }
    public static  String FILE_NAME = &quot;Deferredpersons.txt&quot;;
    public static  String ERROR = &quot;Error&quot;;
    public static  String NO = &quot;no&quot;;
    public String deffercheck(String ssn) {
     //String finderString = ssn.trim().concat(&quot;;&quot;);
     //File file = new File(FILE_NAME);
     //try {
     //Scanner scanner = new Scanner(file);
     //while (scanner.hasNextLine()) {
     //String line = scanner.nextLine();
     //if (line.startsWith(finderString)) {
     //return line.replaceFirst(finderString, &quot;Yes: &quot;);
     //}
     //}
     //return NO;
     //} catch (FileNotFoundException e) {
     return &quot;no&quot;;
   }}
  
  
  // public String deffercheck(String ssn) {
  // return checkPersonLoan(ssn);
  // }
  </code></pre>
  <p>The error in third server is:</p>
  <pre class="lang-none prettyprint-override"><code>Exception in thread &quot;Thread-0&quot; java.lang.InstantiationError: org.apache.xmlrpc.XmlRpcRequest
      at org.apache.xmlrpc.XmlRpcRequestProcessor.processRequest(XmlRpcRequestProcessor.java:118)
      at org.apache.xmlrpc.XmlRpcWorker.execute(XmlRpcWorker.java:182)
      at org.apache.xmlrpc.XmlRpcServer.execute(XmlRpcServer.java:151)
      at org.apache.xmlrpc.XmlRpcServer.execute(XmlRpcServer.java:139)
      at org.apache.xmlrpc.WebServer$Connection.run(WebServer.java:773)
      at org.apache.xmlrpc.WebServer$Runner.run(WebServer.java:656)
      at java.lang.Thread.run(Thread.java:750)
  Exception in thread &quot;Thread-1&quot; java.lang.InstantiationError: org.apache.xmlrpc.XmlRpcRequest
      at org.apache.xmlrpc.XmlRpcRequestProcessor.processRequest(XmlRpcRequestProcessor.java:118)
      at org.apache.xmlrpc.XmlRpcWorker.execute(XmlRpcWorker.java:182)
      at org.apache.xmlrpc.XmlRpcServer.execute(XmlRpcServer.java:151)
      at org.apache.xmlrpc.XmlRpcServer.execute(XmlRpcServer.java:139)
      at org.apache.xmlrpc.WebServer$Connection.run(WebServer.java:773)
      at org.apache.xmlrpc.WebServer$Runner.run(WebServer.java:656)
      at java.lang.Thread.run(Thread.java:750)
  </code></pre>
  <p>And error in server is unexpected end of file from server.</p>