【发布时间】:2011-11-29 18:13:02
【问题描述】:
我在 Google App Engine 中为我的 Restlet 服务器遵循了本教程:http://wiki.restlet.org/docs_2.0/13-restlet/21-restlet/318-restlet/303-restlet.html 它适用于 GWT 客户端。
现在我正在尝试使用 OSGi 和 Restlet 构建一个 jse2 桌面客户端。
OSGi 包中 Restlet 客户端的代码与提供的教程相同。
当我启动 OSGi Felix 框架时,我还启动了 org.restlet.jar 包,该包用于导出 restlet 框架包,并使用 toturail 中给出的此代码启动包:
ClientResource cr = new ClientResource("localhost:8888/contacts/123");
// Get the Contact object
ContactResource resource = cr.wrap(ContactResource.class);
Contact contact = resource.retrieve();
ContactResoure 接口与捆绑激活器在同一个包中,但我仍然收到这条奇怪的消息:java.lang.IllegalArgumentException: interface nl.nhl.minor.crm.desktop.restlet.ContactResource is not visible from类加载器
这个问题与 OSGi 或 Restlet 有关吗?我该如何解决这个问题?
OSGi 包的清单文件由 maven 包插件创建。
【问题讨论】: