Error is in this code:
public String getVersion() {
String result = null;
int index = this.getRequest().getProtocol().indexOf(47);
if (index != -1) {
result = this.getRequest().getProtocol().substring(index + 1);
}
return result;
}
Error is "Couldn't find the mandatory "Host" HTTP header.":
10:34:29,889 INFO [org.restlet] (Thread-6 (HornetQ-client-global-threads-1773619305)) Couldn't find the mandatory "Host" HTTP header.
10:34:29,910 WARNING [org.restlet.Component.Server] (Thread-6 (HornetQ-client-global-threads-1773619305)) Error while handling an HTTP server call: java.lang.NullPointerException
at org.restlet.ext.servlet.internal.ServletCall.getVersion(ServletCall.java:370) [org.restlet.ext.servlet-2.4.0.jar:]
at org.restlet.engine.adapter.ServerAdapter.toRequest(ServerAdapter.java:229) [org.restlet-2.4.0.jar:]
at org.restlet.ext.servlet.internal.ServletServerAdapter.toRequest(ServletServerAdapter.java:62) [org.restlet.ext.servlet-2.4.0.jar:]
at org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:141) [org.restlet-2.4.0.jar:]
at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1117) [org.restlet.ext.servlet-2.4.0.jar:]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:86) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
Code that triggered this is basic:
Queue queue = QueueFactory.getQueue(milkID + "-queue");
String taskUrl = "/milks/" + milkID;
queue.add(TaskOptions.Builder.withUrl(taskUrl)
.param("param1", param1));
From what it seems the call coming from this queue is missing something, so Restlet is throwing out. The odd thing is, this same code works in GAE cloud (Appspot) and even on AppScale, it is only CapeDwarf that is throwing out this error. What could be wrong?
Here's a work-around I did:
But instead of getting less errors, it wreck havoc into Capedwarf runtime:
Best solution I have is to run with the GAE SDK:
And it works perfect without issues, it seems Capedwarf missed to pass important stuff in the servlet chain.