gwt-dev.jar too big to upload to appengine. Can I

2019-04-13 11:18发布

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?

5条回答
\"骚年 ilove
2楼-- · 2019-04-13 11:40

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

查看更多
啃猪蹄的小仙女
3楼-- · 2019-04-13 11:46

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.

查看更多
我命由我不由天
4楼-- · 2019-04-13 11:51

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.

查看更多
闹够了就滚
5楼-- · 2019-04-13 11:53

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.

查看更多
在下西门庆
6楼-- · 2019-04-13 12:02

@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.

查看更多
登录 后发表回答