title: Ehcache - Replicated Caching using RMI
body: <p>I tried using the ehcache and it worked. And I am just trying to implement distributed caching with ehcache RMI. I followed the steps provided in the url: <a href="http://ehcache.org/documentation/distributed_caching_with_rmi.html?cf03800515=21D4D871!NTAxODEzNDE0OmNvcnByYWRpdXNzc286vsRypkVtSPb7t3MnL22gFQ==#" rel="nofollow">http://ehcache.org/documentation/distributed_caching_with_rmi.html?cf03800515=21D4D871!NTAxODEzNDE0OmNvcnByYWRpdXNzc286vsRypkVtSPb7t3MnL22gFQ==#</a></p>
  
  <p>But I could not find the distributed caching working... </p>
  
  <pre><code>&lt;cacheManagerPeerProviderFactory
  class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
  properties="peerDiscovery=manual,
  rmiUrls=//&lt;remotemachineip&gt;:&lt;i want to know what port id should be given here&gt;/deviceCache1"/&gt;
  
  &lt;cacheManagerPeerListenerFactory
  class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
  properties="hostName=&lt;localmachineip&gt;,port=&lt;i want to know what port id should be given here&gt;,
  socketTimeoutMillis=120000"/&gt;
  </code></pre>
  
  <p>I gave some port number and I am having the standalone java code in two machines. 
  First, I run the main program in my friend's machine which puts data to "deviceCache1" and I try to access that cache in my main program. But I don't find any connection happening between two machines.</p>
  
  <p>I may sound silly, but I need to know few things regarding caching. Please some one clarify my doubts and help me.
  So, My questions are:
  1. What port ids need to be given in ehcache.xml in both machines?
  2. Do i need to have some windows service enabled to use rmi ports?
  3. Do i need to add any other code for connection between 2 machines?</p>
  
  <p>Please help me asap.
  Thanks</p>