javax.imageio.IIOException:! Can not create cache file found a problem

  • javax.imageio.IIOException:! Can not create cache file found a problem
  • This represents what, view the log, found to be caused by a file not found: java.nio.file.NoSuchFileException: xxx ... / temp / imageio4138671232726624650.tmp
  • The main reason is the use of imgio package to operate, the default cache directory will be used: $ {tomcat} / temp, in this cache directory will generate cache file timestamps .tmp (which should be a string of numbers is the current time stamp, temporary file name ), but some tomcat, temp directory will be deleted, so an error
  • Solution:
  1. Create a temp directory under the installation directory of tomcat
  2. ImageIO.setCacheDirectory (cacheDirectory): set any, existing cache directory
  3. In this way I am more respected: ImageIO.setUseCache (false) to set up, change the caching policy, do not use the file directory cache, use cache memory

Guess you like

Origin blog.csdn.net/weixin_42479155/article/details/90312055