IOException during generation of HTML report
症状
Generation of HTML Clover report throws IOException like follows:
Writing HTML report to ...
javax.imageio.IIOException: Can't create output stream!
at javax.imageio.ImageIO.write(ImageIO.java:1560)
at clover.org.jfree.chart.encoders.SunPNGEncoderAdapter.encode(SunPNGEncoderAdapter.java:127)
at clover.org.jfree.chart.encoders.EncoderUtil.writeBufferedImage(EncoderUtil.java:188)
at clover.org.jfree.chart.ChartUtilities.writeBufferedImageAsPNG(ChartUtilities.java:615)
at clover.org.jfree.chart.ChartUtilities.writeChartAsPNG(ChartUtilities.java:204)
at clover.org.jfree.chart.ChartUtilities.saveChartAsPNG(ChartUtilities.java:343)
at com.cenqua.clover.reporters.util.CloverChartFactory.generateSrcFileCharts(CloverChartFactory.java:199)
at com.cenqua.clover.reporters.html.FullHtmlReporter.createCurrentReportImpl(FullHtmlReporter.java:317)
at com.cenqua.clover.reporters.html.HtmlReporter.createCurrentReport(HtmlReporter.java:107)
at com.cenqua.clover.reporters.html.HtmlReporter.mainImpl(HtmlReporter.java:293)
at com.cenqua.clover.reporters.html.HtmlReporter.main(HtmlReporter.java:283)
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)
... 10 more
Caused by: java.io.IOException: The filename, directory name, or volume label syntax is incorrect
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)
... 11 more
原因
Clover was unable to create a temporary file in java.io.tmpdir for chart images.
ソリューション
Check what is a value of java.io.tmpdir. In case of Windows, check value of TMP and TEMP variables. Check write permission to this location.
Change to different location if necessary - either by declaring TMP variable or setting -Djava.io.tmpdir property for java process.
set TMP=c:\TEMP
java -cp clover.jar com.cenqua.clover.reporters.html.HtmlReporter ...
or
java -cp clover.jar -Djava.io.tmpdir=C:\TEMP com.cenqua.clover.reporters.html.HtmlReporter ...
最終更新日: 2012 年 12 月 7 日
Powered by Confluence and Scroll Viewport.