最近的項目因爲OP分配的機器沒有配Redis或Mem,爲了解決tomcat的集羣問題,項目使用了Ehcache做爲緩存.Ehcache使用RMI進行同步,但在本地測試時出現了緩存未同步的問題.最終在Ehcache的官網發現了下面這段話:緩存
Tomcat on Windows
Any RMI listener will fail to start on Tomcat, if the installation path has spaces in it. Because the default on Windows is to install Tomcat in 「Program Files」, this issue will occur by default. The workaround is to remove the spaces in your Tomcat installation path.tomcat
調整了tomcat的路徑後發現緩存已經成功同步.測試