On every request made to the Restlet resources, I see the following logs in Google App Engine Logs
21:38:50.059 javax.servlet.ServletContext log: ExampleAPIs: [Restlet] ServerServlet: component class is null
21:38:51.568 javax.servlet.ServletContext log: ExampleAPIs: [Restlet] Attaching application: com.example.api.ExampleAPIConfig@68ec99 to URI: /example/v1
Why does it say Component is null? I agree that I did not define Components rather used ServerResources and mapped them to the router in the Application class. But thats how it is supposed to be done as per the Restlet GAE Edition documentation.
Application class for wiring routes
public Example extends Application {
@Override
public Restlet createInboundRoot() {
router = new Router(getContext());
CorsService corsService = new CorsService();
corsService.setAllowedOrigins( new HashSet<String>(Arrays.asList("http://example.com")));
corsService.setAllowedCredentials(true);
getServices().add(corsService);
router.attach("/xyz", XYZ.class);
}
}
Server Resource which handles and returns a JSON Representation
public class XYZ extends ServerResource {
private static final Logger logger = Logger.getLogger("API:Xyz");
@Get(":json")
public Representation handleGetRequest() {
..
return new JsonRepresentation("{\"code\": 4008, \"description\": \"Something blah something\"}");
}
}
Is there something I am doing wrong ?