title: how to achieve compression with spring-rmi
body: <p>I'm trying to implement custom socket factory for compression in our Spring-rmi Application.</p>
  
  <p>below is the rmi-server configuration : </p>
  
  <pre><code>&lt;bean id="parentRmiServiceExporter" class="org.springframework.remoting.rmi.RmiServiceExporter" abstract="true"&gt;
      &lt;property name="registryPort" value="${rmi.port}"/&gt;
      &lt;property name="registerTraceInterceptor" value="false"/&gt;
      &lt;!-- gZip Server and Client Socket Factory --&gt;    
      &lt;property name="clientSocketFactory" ref=egsZipClientSocketFactory/&gt;   
      &lt;property name="serverSocketFactory" ref="egsZipServerSocketFactory" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>Compression Stream is based on below implementation  :</p>
  
  <p><a href="http://jmvidal.cse.sc.edu/csce790/handouts/sockets/CompressionInputStream.java.html" rel="nofollow">http://jmvidal.cse.sc.edu/csce790/handouts/sockets/CompressionInputStream.java.html</a></p>
  
  <p>however i am getting below error on rmi client start up:</p>
  
  <pre><code> Caused by: java.net.SocketException: Software caused connection abort: socket write error
      at java.net.SocketOutputStream.socketWrite0(Native Method) [rt.jar:1.7.0_15]
      at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109) [rt.jar:1.7.0_15]
      at java.net.SocketOutputStream.write(SocketOutputStream.java:132) [rt.jar:1.7.0_15]
  </code></pre>
  
  <p>how to achieve compression with spring-rmi app ? </p>