在GWT中导入包问题

时间:2010-03-31 18:02:03

标签: eclipse gwt package gwt-designer

我正在使用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.

....我用Google搜索了但是我感到困惑。我是GWT的初学者。我该如何解决这个问题?

谢谢和问候, Krt_Malta

4 个答案:

答案 0 :(得分:3)

问题可能来自GWT Designer。请参阅有关GWT Google小组的这些讨论:GWT Designer errors in EclipseCannot found source in GWT Project

您可以卸载GWT Designer插件^^或change the settings

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

答案 1 :(得分:0)

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

答案 2 :(得分:0)

VideoTutorialServiceService等wsimport是否生成了文件?如果是,那么它们将不适用于GWT。

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

答案 3 :(得分: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文件。