GWTP - An error occurred while trying to write a batch of images

I get a lot of these errors when trying to build a gwtp + mgwt application using ant -

  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.javahaps97)
      [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 data93)
      [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∗58)
      [java] at com.google.gwt.resources.rg.ImageBundleBuilder.toPng (ImageBundleBuilder.java►44)
 ...

The application works fine in dev mode. Any ideas?

+4
source share
2 answers

Perhaps the GWT compiler is losing file descriptors (hence the “Too many open files” exception). Perhaps you are in an environment that limits the number of open files per user (this is your own machine)?

Check all user limits with ulimit -a .

You can try to increase the open file limit with ulimit -Hn <number> . This should at least help you diagnose.

+2
source

Had exactly the same problem (and error message).

Found solution in this thread in Google Groups (GWT)
I use Linux (I do not know if this is your case)

In / etc / security / limits.conf I added

 * soft nofile 65535 * hard nofile 65535 

To apply the new settings, log in and again.

+1
source

All Articles