如何在 Eclipse 项目上运行 GWT RequestFactory 验证工具
我有一个 Android AppEngine 连接项目,正在尝试在 Eclipse IDE 上使用 GWT2.4 RequestFactory 和 Objectify 构建。
显然我需要运行 RequestFactory 验证工具,因为我正在使用 ServiceName 和 ProxyForName 注释(这些注释是必需的,尤其是在 Android 客户端上工作时)。我的问题是 Eclipse 无法验证它,并且 提供的解决方案http://code.google.com/p/google-web-toolkit/wiki/RequestFactoryInterfaceValidation#IDE_configuration 足以让我眼花缭乱。
由于我在 Windows 机器上工作,因此提供的 shell 脚本不是很有用。尝试从 cmd propt 运行验证工具会返回错误消息:“此工具必须使用 JDK,而不是 JRE 运行”
有人可以解释一下此工具应该如何运行吗?有没有办法将它用作 eclipse 中的外部工具?
I've got a Android AppEngine Connected Project I'm trying to build using GWT2.4 RequestFactory and Objectify on my Eclipse IDE.
Apparently I need to run the RequestFactory Validation Tool because I'm using ServiceName and ProxyForName annotations (these are required especially when working on the Android client side). My problem is the Eclipse can't validate it and the solution provided at http://code.google.com/p/google-web-toolkit/wiki/RequestFactoryInterfaceValidation#IDE_configuration is enough to make me rip my eyes out.
Since I'm working on a Windows machine, the shell script provided is not very useful. Trying to run Validation Tool from a cmd propt returns the error message:"This tool must be run with a JDK, not a JRE"
Can someone explain how this Tool is supposed to be run? Is there a way to use it as an External Tool in eclipse?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
通常,如果您仔细按照所显示的链接中的说明进行操作,并从 Eclipse 运行 GWT 开发模式,则验证应该在您使用浏览器访问开发 URL 时自动完成。
根据记录,我实际上遇到了一些问题,但是多次启动该应用程序使其工作。
Normally if you follow carefully the instructions in the link you show, and run the GWT Development Mode from Eclipse, the Validation should be done automatically at the time you access the development URL with your browser.
For the record, I've actually had some problems with it, but launching the application several times maked it work.
嗯,我也遇到了同样的问题。当我尝试注释处理(在Java编译器->注释处理下)被禁用。因此没有生成 RequestFactoryDeobfuscatorBuilder。尝试启用它并重建您的项目。
Well, I ran into the same problem as well. When I tried annotation processing (under Java Compiler-> Annotation processing )was being disabled. So RequestFactoryDeobfuscatorBuilder was not being generated. Try enabling that and rebuilding your project.
我刚刚从一个项目中寻找这个错误的两天中恢复过来,该项目过去可以正常运行验证,但后来停止了。
就我而言,我有一个新的通用 BaseRequestContext 和一个扩展它的特定子接口。我的父接口声明了一个与定位器不完全匹配的方法(例如 getThing(T) 与 get(T)),这并没有报告为错误,但确实阻止了验证工具完成。
I've just recovered from two days of hunting this bug down in a project that used to run validation properly but stopped.
In my case I had a new-ish generic BaseRequestContext and a specific sub-interface that extended it. My parent interface declared a method that didn't match the Locator's exactly (e.g. getThing(T) vs get(T)) and this wasn't reported as an error but did stop the validation tool from completing.
Apt 也在 Java 8 中被删除: http://openjdk.java.net/jeps/117 。所以要小心。
如果您使用的是 Java 8,切换回 Java 7 将解决该问题。
Apt is also removed in Java 8 : http://openjdk.java.net/jeps/117 . So beware.
Switching back to Java 7 will fix the issue if you are using Java 8.
我明白为什么在项目中有时会发生错误:编译器抱怨它找不到目录 .apt 。但是当我尝试手动创建它时,这是不可能的(在Windows下)。我认为验证工具消除了无法创建目录的异常:尝试在验证工具调用中重命名 .apt (在项目中进行文本搜索)
I understood why the error happens sometimes in a project: the compiler was complaining it cannot find the directory .apt . But when I tried to create it manually it was not possible (under windows). I think the validation tool mutes the exception of not being able to create the directory: try renaming .apt in your validation tool calls (do a text search in your project)