问题
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?
回答1:
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.
回答2:
You could use the Windows command line:
\path\to\appcfg.cmd --enable_jar_splitting update path\to\war
See how to create a deploy shortcut here.
回答3:
gwt-user should not be in the resulting jar, as its dependency scope is provided. Or at least it should be. The instructions from David Chandler, part of the GWT team suggest that the maven-clean-plugin should be used to remove the jar from the resulting WAR file.
回答4:
@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 the splitJars parameter.
回答5:
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
来源:https://stackoverflow.com/questions/5477977/gwt-dev-jar-too-big-to-upload-to-appengine-can-i-split-a-jar-file-or-what