I recently had to add gwt-dev.jar to my /war/WEB-INF/lib directory, and now when I try to deploy to appengine I get:
java.lang.IllegalStateException: Found a jar file too large to upload: "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\appcfg997121487626565419.tmp\WEB-INF\lib\gwt-dev.jar". Consider using --enable_jar_splitting.
I'm using the google eclipse plugin, and according to this issue report I can't use --enable_jar_splitting. Ack!
Can I manually split a jar file apart somehow? I only need a tiny fraction of the thing. If not, what should I do?
I was getting the same error (ironically for the same reason, gwt-dev.jar added to WEB-INF/lib to appease dependencies). In the end I was able to get the app to start AND upload to app engine by ditching gwt-dev.jar and adding xalan.jar to the WEB-INF/lib.
I think Peter Knego is right, it's better _not_to upload the gwt-dev.jar
Extract the jar. You'll get a folder structure analogous to that of a java package hierarchy (e.g. com/google/gwt/core). Copy the entire extracted directory structure into war/WEB-INF/lib. Solved.
On linux, you can extract the jar with with
jar -xvf gwt-dev.jar
. On windows, just rename it to a zip and you can extract it like a normal zip file (jar files are actually zip files in disguise)Any single file larger than 1MB will not upload to the App Engine.
gwt-user
should not be in the resulting jar, as its dependency scope isprovided
. Or at least it should be. The instructions from David Chandler, part of the GWT team suggest that themaven-clean-plugin
should be used to remove the jar from the resulting WAR file.You could use the Windows command line:
See how to create a deploy shortcut here.
@Robert is right, you should just delete
gwt-user.jar
prior to uploading. If you really have a big jar, use--enable_jar_splitting
as proposed by @systempuntoout. If you're using Maven, the equivalent of--enable_jar_splitting
is available with the maven-gae-plugin via thesplitJars
parameter.