尝试将 GWT 集成到 OSGi 包中
我正在尝试将 GWT 与 OSGi (Equinox) 集成,为我的模块化系统的其余部分提供基于 Web 的 UI。到目前为止,我已经成功地将 GWT servlet 嵌入到 OSGi 模块中。
我使用的是 Eclipse GWT 插件生成的 GWT 示例代码项目,它由 3 个包组成:客户端、服务器和共享。服务器包(ui.server.GreetingServiceImpl
)中的类实现了客户端包(ui.client.GreetingService
)中的接口,并且它们都在同一个包中捆。
当我尝试从客户端网页进行远程过程调用时,我收到错误:
IncompleteRemoteServiceException:无法在默认类加载器中找到请求的接口“ui.client.GreetingService”
我收集该类是类加载器找不到,但我不知道如何解决这个问题。我可以通过请求或导入其他包中的类来访问它们,但不能访问与实现类位于同一包中的接口。有人能指出我正确的方向吗?我已经谷歌搜索了几个小时了。
I am trying to integrate GWT with OSGi (Equinox) to provide a web based UI for the rest of my modular system. So far I've managed to embed the GWT servlet in the OSGi module.
I am using the GWT sample code project generated by the Eclipse GWT plugin, which consists of 3 packages: client, server and shared. The class in the server package (ui.server.GreetingServiceImpl
) implements the interface in the client package (ui.client.GreetingService
), and all of them are in the same bundle.
When I try to make a Remote Procedure Call from the client side web page I get the error:
IncompatibleRemoteServiceException: Could not locate requested interface 'ui.client.GreetingService' in default classloader
I gather that the class was not found by the classloader, but I don't know how to fix this. I can access classes in other bundles by requiring or importing them, but not the interface that is in the same bundle as the implementing class. Could anyone point me in the right direction? I've been googling for hours.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
需要在 GreetingServiceImpl 上重写 HttpServlet 的“服务”方法:
因此,应用程序在 Equinox 上运行!
It is needed to override method 'service' from HttpServlet on your GreetingServiceImpl:
Thus, the application runs on Equinox!!
IncompleteRemoteServiceException 表示来自 GUI 的 RPC 调用未找到 @RemoteService 注释指定的接口。
您可以发布带有源代码的项目吗?
顺便说一句,您还可以看看这个项目:
http://code.google.com/p/gwt-in-osgi/
IncompatibleRemoteServiceException means that the RPC call from the GUI didn't found the interface specified by the @RemoteService annotation.
Can you post your project with source codes ?
BTW you can also have a look at this project:
http://code.google.com/p/gwt-in-osgi/