I Followed this tutorial for my Restlet server in the Google App Engine: http://wiki.restlet.org/docs_2.0/13-restlet/21-restlet/318-restlet/303-restlet.html It works fine with the GWT client.
Now i’m trying to build a jse2 desktop client with OSGi and Restlet.
The code for the Restlet client in the OSGi bundle stay’s the same as the tutorail provided.
When i start the OSGi Felix framework i also start the org.restlet.jar bundle who’s exporting the restlet framework packages and i start a bundle with this code given in the toturail:
ClientResource cr = new ClientResource("localhost:8888/contacts/123");
// Get the Contact object
ContactResource resource = cr.wrap(ContactResource.class);
Contact contact = resource.retrieve();
The ContactResoure interface is in the same package as the bundle activator but i still get this strange message: java.lang.IllegalArgumentException: interface nl.nhl.minor.crm.desktop.restlet.ContactResource is not visible from class loader
Is this problem related to OSGi or to Restlet? And how can I solve this problem?
The manifest files for the OSGi bundles are created by the maven bundle plugin.
The correct way of loading a class is easy:
This solution give you a other problem, the class isn’t imported by the org.restlet bundle.
See import package without edit the manifest file in org.restlet for my question about that problem.