In general Ehcache configuration, the default Diskstore path is set to Java.io.tmpdir, which is equal to the temporary directory of the current system.
However, on both Tomcat and Resin, the temporary directory is different, the application running on Tomcat is obtained by the JAVA.IO.TMPDIR system variable is the TEMP subdirectory under the Tomcat directory, and Resin returns the System Pro Time directory, Linux may be the/tmp
This problem does not exist under Linux if we use the root account to start Tomcat and Resin. However, we do not recommend the use of root to start Tomcat and Resin, we will create a separate non-privileged account, assuming that the account name is www to run the application server.
We need to authorize the directory where Tomcat and Resin are located to the WWW account so that the application server log files can be written properly, but because the Resin temp directory is the/tmp directory of the corresponding system, if Ehcache is used in the application and the storage path is set to Java. Io.tmpdir, you will find an error when booting, prompted not to create a file in the/tmp directory permissions, this is because the WWW account does not write the TMP directory permissions.
The solution is to modify the value of the Ehcache diskstore configuration to User.home, and specify the storage file path to the user's home directory.
Tomcat does not have this problem because its temp directory is in {tomcat}/temp, and the entire {TOMCAT} has been authorized to the WWW account.
Original: http://www.oschina.net/question/12_2368