GWT, Guice and GIN compilation

霸气de小男生 提交于 2019-12-11 04:35:29

问题


I'm trying to build and GWT MVP application using Guice and Gin. I added Guice and GIN jars to my Eclipse project but i'm stuck with this error:

java.lang.NoClassDefFoundError: com/google/inject/internal/util/$Preconditions

I've done a quick Google search and here says the we need to recompile GIN against GWT SDK. Also, the Gin Tutorial mention something about a compilation step.

Isn't enough to add GIN jars to the GWT project, or is mandatory to generate gin.jar from sources? How do i accomplish this with Eclipse (with Google Plugin)?

PS: I'm not using Maven in my Project. Only Eclipse and Google Tools Another PS: Currently using Guice 3.0, Gin 1.5 and GWT 2.3


回答1:


If you are using GWT 2.2 or above try using a latest snapshot of gin 1.1 or higher versions and also upgrade guice 3.0.




回答2:


For Gin 1.5 there is a pre-gwt-2.2 jar and a post-gwt-2.2 jar. Make sure you have the right one. And probably only one of them should be in the WEB-INF/lib. Make sure both gin and guice are in the lib and in Java Build Path->Libraries. I also have aopalliance.jar, guice-assistedinject-3.0.jar and javax.inject.jar. (Also guice-servlet but that isn't part of the problem here). Make sure you have " " in your .gwt.xml file.

And remember in dev mode that gin uses guice to do most of the work.



来源:https://stackoverflow.com/questions/9403815/gwt-guice-and-gin-compilation

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!