`

Caused by: javax.imageio.IIOException: Can't create cache file!

阅读更多

   验证码 无法显示问题。

   错误日志为:
Caused by: javax.imageio.IIOException: Can't create cache file!
	at javax.imageio.ImageIO.createImageOutputStream(ImageIO.java:397)
	at javax.imageio.ImageIO.write(ImageIO.java:1558)
	... 119 more
Caused by: java.io.IOException: 系统找不到指定的路径。
	at java.io.WinNTFileSystem.createFileExclusively(Native Method)
	at java.io.File.checkAndCreate(File.java:1704)
	at java.io.File.createTempFile(File.java:1792)
	at javax.imageio.stream.FileCacheImageOutputStream.<init>(FileCacheImageOutputStream.java:71)
	at com.sun.imageio.spi.OutputStreamImageOutputStreamSpi.createOutputStreamInstance(OutputStreamImageOutputStreamSpi.java:50)
	at javax.imageio.ImageIO.createImageOutputStream(ImageIO.java:393)
	... 120 more
javax.imageio.IIOException: Can't create output stream!
	at javax.imageio.ImageIO.write(ImageIO.java:1560)
	at net.sxinfo.common.struts2.xwork2.AuthCodeAction.execute(AuthCodeAction.java:64)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)



跟踪问题日志,原来是ImageIO.write(image, "jpeg", response.getOutputStream());

需要写缓冲文件,但是写文件不成功。

经查看官方文档,原因是删除了tomcat的temp目录。

手动创建temp目录,问题解决!(temp 目录 与 bin 目录 同级)。


0
2
分享到:
评论
发表评论

文章已被作者锁定,不允许评论。

相关推荐

Global site tag (gtag.js) - Google Analytics