GWT 编译“添加入口点模块”对话
谁能解释 Eclipse GWT 插件在哪里定义它的入口点?
为了让我的旧 GWT 项目再次使用 GWT 2.0,我在 Eclipse 中创建了一个默认的 GWT 2.0 项目并能够成功运行它。它会请求名称并调用服务器上的“greet”servlet,该 servlet 会做出响应等等……到目前为止一切顺利。
然后,我将旧的 Maven GWT 项目中的所有类移植到这个新的 GWT 项目中,希望 RPC 调用能够正常工作。它有很多依赖项,因此我还复制了 maven pom.xml,注释掉了 pom 中所有与 gwt 相关的插件,并设法让 Eclipse M2Eclipse maven 插件识别 pom 并采用所有 maven 依赖项。 Eclipse 中的所有问题现在都已解决,看起来一切顺利。
但是,当我单击项目的 GWT 编译图标时,它会弹出一个“GWT 编译”对话框,现在要求我“添加入口点模块”。此对话框中没有列出可供选择的入口点。这很令人沮丧,因为我保留了完全相同的 GWTApp.gwt.xml 并将代码移至之前工作的自动生成的 GWTApp.java 类中。
我无法想象为什么 Eclipse 插件不查看 GWTApp.gwt.xml 文件来找出入口点是什么。
谁能解释一下这些入口点是如何定义的或建议为什么该项目停止工作?
谢谢!
Can anyone explain where the Eclipse GWT plugin defines it's entry points?
In an attempt to get my old GWT project working again with GWT 2.0, I created a default GWT 2.0 project in Eclipse and was able to run it successfully. It's the one that asks for a name and calls the 'greet' servlet on the server, which responds etc... so far so good.
I then ported all the classes from my older maven GWT project over to this new GWT project in the hopes of getting the RPC calls to work. It had many dependencies, so I also copied over the maven pom.xml, commented out all of the gwt related plugins in the pom, and managed to get the Eclipse M2Eclipse maven pluging to recognize the pom and adopt all of the maven dependencies. All of the issues in Eclipse are now resolved and it looks good to go.
However, when I click on the GWT compile icon for the project, it pops up a "GWT Compile" dialog now asking me to "Add an entry point module". There are no entry points listed to choose from in this dialog. This is frustrating because I kept the exact same GWTApp.gwt.xml and moved my code into the previously-working auto-generated GWTApp.java class.
I can't imagine why the Eclipse plugin doesn't look in the GWTApp.gwt.xml file to figure out what the entry points are.
Can anyone explain how these entry points are defined or suggest why the project stopped working?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我确信以下是问题和解决方案。我从事 GWT 已经大约 6 年了。
每当您将现有的maven(即从Mojo生成的archtype,但也可能是其他)项目导入到eclipse中时,您将得到一个损坏的配置,在修复它之前不允许您进行调试。但修复方法很简单。发生的情况是,构建路径将设置为排除“[proj]/src/main/resources”中的所有文件,这具有从 Eclipse 中隐藏 [proj].gwt.xml 模块文件的效果。因此,所有查找这些模块的 GWT 对话框都看不到它们!因此您甚至无法创建有效的调试配置。
修复方法如下:
右键单击该项目,然后打开“属性”->“属性”。构建路径对话框 -> “源”选项卡,然后查找以“.../src/main/resources”结尾的内容,您将看到它已被排除:。因此,仅突出显示该条目并删除“”,使其显示为“排除:(无)”。现在,GWT 的对话框(即调试配置对话框)将全部看到您的模块文件,并且一切都会正常工作。
I'm certain the following is the problem and solution. I've been doing GWT for about 6 years.
Whenever you import an existing maven (namely from a Mojo-generated archtype, but probably others) project into eclipse, you will get a broken configuration which will not allow you to debug until you fix it. But the fix is simple. What happens is the build path will be set to exclude all files from '[proj]/src/main/resources', and this has the effect of hiding the [proj].gwt.xml module file from eclipse. So all the GWT dialogs that look for those modules can't see them! So you can't even create a debug configuration that works.
Here's the fix:
Right-click the project, and open Properties -> Build Path dialog -> Source Tab, and look for the one ending in '.../src/main/resources', and you will see it has excluded: . So highlight just that entry and remove the '', so that it reads "Excluded: (None)". Now the dialogs (namely the debug configuration dialog), for GWT will all see your module file, and everything will work.
可以肯定的是,这与此内容不同案例,排除过滤器有点太大了?
Just to be sure, that wouldn't be similar to this case, where the exclusion filter was a bit too large?
感谢您对我的问题提出的建议 - 您促使我找到答案。我查看了,没有任何排除过滤器,但检查了项目属性中的 Java 构建路径。
当我添加 Maven 依赖项时,它必须隐式更改 GWT Eclipse 项目的已定义源目录。 (可能是 src/main/java 或任何愚蠢的长篇大论的 maven 默认路径)。 Eclipse 没有提示 Java 类不在项目构建路径上。一旦我为项目显式定义了 src 目录,gwt.xml 模块就会出现在 GWT 编译对话框中!
进入下一个障碍...因为它仍然不起作用! :(
感谢您的帮助!
Thanks for the suggestions to my question - you prompted me to find the answer. I looked and did not have any exclusion filters but checked the Java Build Path in the project properties.
When I'd added the maven dependencies, it must have implicitly changed the defined source directory of the GWT eclipse project. (Probably to src/main/java or whatever that dumb long-winded maven default path is). Eclipse offered no hints that the Java classes were not on the project build path. Once I defined the src directory explicitly for the project, the gwt.xml module appeared in the GWT Compile dialog box!
On to the next hurdle... coz it still ain't working yet! :(
Thanks for your help!
Sonatype 的 eclipse maven 插件因很多事情而臭名昭著。其中之一是每当您允许给定模块重建 Eclipse 类路径时,排除资源 maven 文件夹中的所有文件。
m2eclipse 可能是我使用 Intellij 重新评估的唯一原因......
Sonatype's eclipse maven plugin is infamous for many things. One of them is excluding all the files in your resources maven folder for a given module whenever you allow it to rebuild the eclipse classpath.
m2eclipse will probably be the single reason that I re-evaluate using Intellij...
我也有同样的问题。
出现空对话框(没有建议的入口点)。
经过一番挖掘后,我发现 mymodule.gwt.xml 文件在 .classpath(项目文件夹根目录中的 eclipse 项目文件)中被意外标记为“lib”。我似乎它在 .classpath 自动生成上被标记为“lib”(我正在导入干净的 maven GWT 项目,而不是 eclipse 项目)。
只需从 .classpath 文件中删除 mymodule.gwt.xml 行,因为它位于 src/main/resources 中,这是正常的“src”类路径。
I had the same problem.
There was empty dialog (no entry points suggested).
After some digging I found that mymodule.gwt.xml file was accidentally marked as "lib" in .classpath (eclipse project file in the root of the project folder). I seems it was marked as "lib" on .classpath automatic generation (I was importing clean maven GWT project, not eclipse project).
Simply delete line with mymodule.gwt.xml from .classpath file, cause it is in src/main/resources, that is normal "src" classpath.
右键单击该项目并选择属性。展开并选择 Google ->网络工具包。右侧窗格将有一个名为入口点模块的部分。单击添加按钮并选择您的 .gwt.xml 文件。
Right click the project and select properties. Expand and select Google -> Web Toolkit. The right pane will have a section called Entry Point Modules. Click the add button and select your .gwt.xml file.