-
Type:
Bug
-
Resolution: Answered
-
Priority:
Low
-
None
-
Affects Version/s: 4.2, 4.2.1
-
Component/s: None
-
Environment:
Centos 5.4
Java 1.6.0, build 17
Tomcat 6.0.29
Jira 4.2.1, WAR
-
4.02
If the java.io.tmpdir directory is missing, Jira gives a big spew of a stacktrace that starts with:
"2010-12-13 18:51:52,439 TP-Processor2 ERROR lajoie 1131x2x1 1qtnanv 24.11.171.109 /rest/api/1.0/header-separator [jira.image.separator.DefaultHeaderSeparatorService] Wow! An IOException occured with a ByteArrayOutputStream. Is that even possible?"
and ultimately identifies the problem as:
Caused by: javax.imageio.IIOException: Can't create cache file!
at javax.imageio.ImageIO.createImageOutputStream(ImageIO.java:413)
at javax.imageio.ImageIO.write(ImageIO.java:1562)
... 141 more
Caused by: java.io.IOException: No such file or directory
at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.checkAndCreate(File.java:1716)
at java.io.File.createTempFile(File.java:1804)
at javax.imageio.stream.FileCacheImageOutputStream.<init>(FileCacheImageOutputStream.java:86)
at com.sun.imageio.spi.OutputStreamImageOutputStreamSpi.createOutputStreamInstance(OutputStreamImageOutputStreamSpi.java:68)
at javax.imageio.ImageIO.createImageOutputStream(ImageIO.java:409)
First, the error message should be fixed. Obviously the developer knows which image file is meant to be created (at least one would certainly hope so). More importantly though, before writing to any directory the code should be checking if that directory exists and if there are appropriate permissions and provide an useful error when those conditions are not meant.