GWT中导入包的问题
我正在使用 GWT Eclipse 插件开发一个应用程序。 (我也在使用 GWT Designer,但我认为问题不在这里)。以前,当我希望 Java 应用程序与我创建的 Web 服务进行通信时,我使用 Sun 的 wsimport 工具从 WSDL url 生成“骨架”类。然后我会将生成的类添加到 Eclipse 项目中的类文件夹中。一切顺利。
然而,这似乎不适用于 GWT。我有这些:
VideoTutorialServiceService service = new VideoTutorialServiceService();
VideoTutorialService port = service.getVideoTutorialServicePort();
并且我有 VideoTutorialServiceService
和 VideoTutorialService
用红色下划线,错误说 videotutorialservice.VideoTutorialServiceService 在源包中找不到。检查模块的继承链;它可能没有继承所需的模块,或者模块可能没有正确添加其源路径条目。
....我用谷歌搜索了它,但我感到困惑。我是 GWT 的初学者。请问我该如何解决这个问题?
谢谢和问候, Krt_马耳他
I'm developing an app using GWT Eclipse plug-in. (I'm also using GWT Designer but I don't think the problem is here). Previously when I wanted a java application to communicate with a web service I created, I produced the "skeleton" classes from the WSDL url using Sun's wsimport tool. Then I would add the classes generated to a class folder in my Eclipse project. All worked well.
However this doesn't seem to be working with GWT. I have these:
VideoTutorialServiceService service = new VideoTutorialServiceService();
VideoTutorialService port = service.getVideoTutorialServicePort();
and I have VideoTutorialServiceService
and VideoTutorialService
underlined in red, the error saying 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.
.... I googled about it but I got confused. I'm a beginnier in GWT. How can I resolve this please?
Thanks and regards,
Krt_Malta
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
该问题可能确实来自 GWT Designer。请参阅有关 GWT Google 群组的讨论:Eclipse 中的 GWT Designer 错误 和在 GWT 项目中找不到源代码。
您可以卸载 GWT Designer 插件 ^^ 或更改设置 :
在 WindowBuilder > 中GWT>生成器
取消选中
检查“客户端”类路径
选项The problem probably does come from the GWT Designer. See these discussions on GWT Google groups : GWT Designer errors in Eclipse and Cannot found source in GWT Project.
You can ever uninstall GWT Designer plugin ^^ or change the settings :
In
WindowBuilder > GWT > Builder
Uncheck the
Check for "client" classpath
option检查 VideoTutorialServiceService 封闭类的大小写。如果您逐字复制/粘贴它,那么它会寻找 videotutorialservice.VideoTutorialServiceService 而不是 VideoTutorialService.VideoTutorialServiceService
Check the capitalization of the VideoTutorialServiceService enclosing class. If you copied/pasted it verbatim then it's looking for videotutorialservice.VideoTutorialServiceService instead of VideoTutorialService.VideoTutorialServiceService
VideoTutorialServiceService 等 wsimport 生成的文件吗?如果是,那么他们将无法使用 GWT。
GWT 不支持所有 java 类。它只支持在 javascript 世界中有意义的子集。请记住,GWT 本质上是一个 java -> javascript 编译器,因此您不能获取任何 java 代码并期望它在 javascript 中正常运行。
Are VideoTutorialServiceService etc. wsimport generated files? If yes, then they won't work with GWT.
GWT doesn't support all java classes. It just supports a sub-set that makes sense in the javascript world. Remember that GWT is essentially a java -> javascript compiler, so you can't take any java code and expect it to run properly in javascript.
我也有类似的问题,我有一个 GWT 2.0 应用程序,我已将其与 spring-security 和 hibernate 集成。在我安装 GWT Designer 之前,它工作正常。然后安装后,我在Eclipse上出现这个错误
org.springframework.orm.hibernate3.support.HibernateDaoSupport在源包中找不到。检查模块的继承链;它可能没有继承所需的模块,或者模块可能没有正确添加其源路径条目。
然后我尝试卸载 GWT Designer,错误消失了。我不知道这是否是 GWT 设计器的错误,因为在我的 eclipse 类路径中,我添加了适当的 jar 文件。
I also had a similar problem, I have a GWT 2.0 app which I have integrated it with spring-security and hibernate. Before I installed GWT Designer it worked okay. Then after installing it, I had this error on 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.
Then I tried uninstalling GWT Designer and the error was gone. I don't know if this is a bug with GWT designer because In my eclipse class path, I had added the appropriate jar files.