PDA

View Full Version : javax.imageio.IIOException: Can't create output stream! Error on Tomcat



anil.kumar
2nd March 2010, 03:31 PM
Sometime when saving image file on tomcat you will got error message like this.


2010-03-02 15:44:48,653 [INFO ] - javax.imageio.IIOException: Can't create output stream!
javax.imageio.IIOException: Can't create output stream!
at javax.imageio.ImageIO.write(Unknown Source)
at com.smd.ui.xc.b(UIUtils.java:705)
at com.smd.c.c.b(SaveReportManager.java:585)
at com.smd.c.c.b(SaveReportManager.java:176)
at com.smd.server.c.e.b(ReportProcessor.java:332)
at com.smd.server.c.e.b(ReportProcessor.java:233)
at com.smd.server.c.e.b(ReportProcessor.java:61)
at com.smd.server.c.e$_b.run(ReportProcessor.java:150 )
at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: javax.imageio.IIOException: Can't create cache file!
at javax.imageio.ImageIO.createImageOutputStream(Unkn own Source)
... 11 more
Caused by: java.io.IOException: The system cannot find the path specified
at java.io.WinNTFileSystem.createFileExclusively(Nati ve Method)
at java.io.File.checkAndCreate(Unknown Source)
at java.io.File.createTempFile(Unknown Source)
at javax.imageio.stream.FileCacheImageOutputStream.<init>(Unknown Source)
at com.sun.imageio.spi.OutputStreamImageOutputStreamS pi.createOutputStreamInstance(Unknown Source)
... 12 more

This can happen if directory ${CATALINA_TMPDIR} (Normally TOMCAT_HOME/temp) dir doesn't exist or not writable by user tomcat runs on.

Solution: Solution is to create temp dir (TOMCAT_HOME/temp)