GWTP - 尝试写入映像包时发生错误

时间:2012-08-24 21:04:43

标签: gwt ant javac gwt-platform mgwt

我在尝试使用ant -

构建gwtp + mgwt app时遇到了很多这些错误
 Preparing method tabBarMoreImage
     [java]                   [ERROR] An error occurred while trying to write the image bundle.
     [java] javax.imageio.IIOException: Can't create output stream!
     [java]     at javax.imageio.ImageIO.write(ImageIO.java:1560)

...
  Preparing method tabBarMostRecentImage
     [java]                   [ERROR] An error occurred while trying to write the image bundle.
     [java] javax.imageio.IIOException: Can't create output stream!
...
 [java] Caused by: javax.imageio.IIOException: Can't create cache file!
     [java]     at javax.imageio.ImageIO.createImageOutputStream(ImageIO.java:397)
     [java]     at javax.imageio.ImageIO.write(ImageIO.java:1558)
     [java]     ... 33 more
     [java] Caused by: java.io.IOException: Too many open files
     [java]     at java.io.UnixFileSystem.createFileExclusively(Native Method)
     [java]     at java.io.File.checkAndCreate(File.java:1704)
     [java]     at java.io.File.createTempFile(File.java:1792)
     [java]     at javax.imageio.stream.FileCacheImageOutputStream.(FileCacheImageOutputStream.java:71)
     [java]     at com.sun.imageio.spi.OutputStreamImageOutputStreamSpi.createOutputStreamInstance(OutputStreamImageOutputStreamSpi.java:50)
     [java]     at javax.imageio.ImageIO.createImageOutputStream(ImageIO.java:393)
     [java]     ... 34 more
     [java]                Preparing method getButtonBarArrowDownImage
     [java]                   [ERROR] An error occurred while trying to write the image bundle.
     [java] javax.imageio.IIOException: Can't create output stream!
     [java]     at javax.imageio.ImageIO.write(ImageIO.java:1560)
     [java]     at com.google.gwt.resources.rg.ImageBundleBuilder.createImageBytes(ImageBundleBuilder.java:558)
     [java]     at com.google.gwt.resources.rg.ImageBundleBuilder.toPng(ImageBundleBuilder.java:544)
...

应用程序在开发模式下运行良好。有什么想法吗?

2 个答案:

答案 0 :(得分:2)

也许GWT编译器正在泄漏文件描述符(因此“Too many open files”异常)。也许你的环境限制了每个用户打开文件的数量(这是你自己的机器)吗?

使用ulimit -a检查所有用户限制。

您可以尝试使用ulimit -Hn <number>来增加打开文件的限制。这应该至少可以帮助您诊断。

答案 1 :(得分:1)

有完全相同的问题(和错误消息)。

在此thread on google groups (GWT)中找到解决方案 我正在使用Linux(我不知道这是不是你的情况)

在/etc/security/limits.conf中我添加了

* soft nofile 65535
* hard nofile 65535

要应用新设置,请重新注销。