GWT Compiler - java.io.IOException: Too many open files

924 views
Skip to first unread message

Jonas

unread,
Feb 14, 2012, 12:07:53 PM2/14/12
to google-we...@googlegroups.com
I've recently started getting these errors when I GWT compile my project for my ClientBundles (which have quite a lot of images).

[java]          Rebinding ...ClientBundle
[java]             Invoking generator com.google.gwt.resources.rebind.context.InlineClientBundleGenerator
[java]                Preparing method taxiExternalImage
[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] 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)

I have tried compiling with localWorkers=1 and -Dgwt.persistentunitcache=false but it doesn't help.
GWT is version 2.4. My complete flags for the GWT compile are:

-optimize 9 -strict -XdisableClassMetadata -XdisableCastChecking -localWorkers 1

Now I can't compile my project anymore, these errors happened only sometimes before but now all the time.
Any ideas on what I can try to solve this?

Paul Robinson

unread,
Feb 15, 2012, 3:43:15 AM2/15/12
to google-we...@googlegroups.com
When building a ClientBundle with images, the compiler holds all the source image files open at the same time, even if you never refer to the image in your code. This can be a problem if you've got a lot of images in the bundle interface. I think this is probably a bug, and I thought there was an issue open for it, but I can't find it now so maybe there isn't one.

The bottom line is that you either need fewer images in your client bundle, or you need to increase the number of open files that you're allowed to have. If you're on linux, google for "too many open files" to find out how to do this.

Paul
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/tzDHqywhMtcJ.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Jonas

unread,
Feb 15, 2012, 4:40:17 AM2/15/12
to google-we...@googlegroups.com
Thanks, it turns it the limit of open files on my ubuntu server where I compile was 1024.
If anyone have the same problem I solved it by using this guide: http://lj4newbies.blogspot.com/2007/04/too-many-open-files.html

In /etc/security/limits.conf I added

* soft nofile 65535
* hard nofile 65535
Reply all
Reply to author
Forward
0 new messages