javagoogle-app-enginecapedwarf

Unable to run capedwarf.sh <path>


Running capedwarf.sh <path> throws this error:

03:08:16,369 INFO  [org.restlet] (Thread-0 (HornetQ-client-global-threads-266112928)) Couldn't find the mandatory "Host" HTTP header.
03:08:16,440 WARNING [org.restlet.Component.Server] (Thread-0 (HornetQ-client-global-threads-266112928)) 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.3.5.jar:]
    at org.restlet.engine.adapter.ServerAdapter.toRequest(ServerAdapter.java:226) [org.restlet-2.3.5.jar:]
    at org.restlet.ext.servlet.internal.ServletServerAdapter.toRequest(ServletServerAdapter.java:62) [org.restlet.ext.servlet-2.3.5.jar:]
    at org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:141) [org.restlet-2.3.5.jar:]
    at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1117) [org.restlet.ext.servlet-2.3.5.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]
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:130) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
    at io.undertow.websockets.jsr.JsrWebSocketFilter.doFilter(JsrWebSocketFilter.java:129) [undertow-websockets-jsr-1.1.8.Final.jar:1.1.8.Final]
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
    at org.jboss.capedwarf.appidentity.GAEFilter.doFilter(GAEFilter.java:62) [capedwarf-appidentity-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
    at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:85) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
    at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
    at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
    at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.8.Final.jar:1.1.8.Final]
    at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
    at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.8.Final.jar:1.1.8.Final]
    at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) [undertow-core-1.1.8.Final.jar:1.1.8.Final]
    at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
    at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58) [undertow-core-1.1.8.Final.jar:1.1.8.Final]
    at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
    at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) [undertow-core-1.1.8.Final.jar:1.1.8.Final]
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.8.Final.jar:1.1.8.Final]
    at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.8.Final.jar:1.1.8.Final]
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.8.Final.jar:1.1.8.Final]
    at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:261) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
    at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:248) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
    at io.undertow.servlet.handlers.ServletInitialHandler.dispatchMockRequest(ServletInitialHandler.java:235) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
    at io.undertow.servlet.spec.RequestDispatcherImpl.mock(RequestDispatcherImpl.java:425) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
    at org.jboss.as.capedwarf.services.Hack.invoke(Hack.java:50)
    at org.jboss.as.capedwarf.services.ServletExecutor.dispatch(ServletExecutor.java:82)
    at org.jboss.as.capedwarf.services.ServletExecutorConsumer.onMessage(ServletExecutorConsumer.java:126)
    at org.hornetq.jms.client.JMSMessageListenerWrapper.onMessage(JMSMessageListenerWrapper.java:103)
    at org.hornetq.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:1116)
    at org.hornetq.core.client.impl.ClientConsumerImpl.access$500(ClientConsumerImpl.java:56)
    at org.hornetq.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:1251)
    at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:104)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [rt.jar:1.8.0_163]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_163]
    at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_163]

The app is a Restlet Framework (version 2.3.5) based backend.


Solution

  • I'm not familiar with Capedwarf, and it seems it requires the host header where App Engine doesn't. You may solve this issue by adding the host header manually to your task, like this:

    queue.add(TaskOptions.Builder.withUrl(taskUrl)
        .header("Host","your_host_name")
        .param("param1", param1));