1

我正在使用 GWT Eclipse 插件开发应用程序。(我也在使用 GWT Designer,但我认为问题不在这里)。以前,当我想要一个 Java 应用程序与我创建的 Web 服务进行通信时,我使用 Sun 的 wsimport 工具从 WSDL url 生成了“骨架”类。然后我会将生成的类添加到我的 Eclipse 项目中的类文件夹中。一切运作良好。

但是,这似乎不适用于 GWT。我有这些:

VideoTutorialServiceService service = new VideoTutorialServiceService();
VideoTutorialService port = service.getVideoTutorialServicePort();

我有VideoTutorialServiceServiceVideoTutorialService用红色下划线,错误说videotutorialservice.VideoTutorialServiceService can not be found in source packages. Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly.

....我用谷歌搜索了它,但我很困惑。我是 GWT 的初学者。请问我该如何解决?

谢谢和问候, Krt_Malta

4

4 回答 4

3

问题可能确实来自 GWT 设计器。请参阅 GWT Google 组中的这些讨论:Eclipse 中的 GWT Designer 错误在 GWT 项目中找不到源

您可以卸载 GWT Designer 插件 ^^ 或更改设置

WindowBuilder > GWT > Builder
取消选中该Check for "client" classpath选项

于 2010-12-07T09:14:24.787 回答
0

VideoTutorialServiceService 等是 wsimport 生成的文件吗?如果是,那么它们将无法与 GWT 一起使用。

GWT 不支持所有的 java 类。它只支持在 javascript 世界中有意义的子集。请记住,GWT 本质上是一个 java -> javascript 编译器,因此您不能获取任何 java 代码并期望它在 javascript 中正常运行。

于 2010-03-31T19:53:13.043 回答
0

检查 VideoTutorialServiceService 封闭类的大小写。如果您逐字复制/粘贴它,那么它正在寻找 videotutorialservice.VideoTutorialServiceService 而不是 VideoTutorialService.VideoTutorialServiceService

于 2010-03-31T19:02:38.007 回答
0

我也有类似的问题,我有一个 GWT 2.0 应用程序,我将它与 spring-security 和 hibernate 集成。在我安装 GWT Designer 之前,它工作正常。然后在安装它之后,我在 Eclipse 上出现了这个错误org.springframework.orm.hibernate3.support.HibernateDaoSupport can not be found in source packages. Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly. 然后我尝试卸载 GWT Designer 并且错误消失了。我不知道这是否是 GWT 设计器的错误,因为在我的 eclipse 类路径中,我添加了适当的 jar 文件。

于 2011-03-02T06:54:29.620 回答