Search code examples
tomcatcordovagwtrpcgwt-rpc

GWTphonegap PhonegapUtil.prepareService RPC call results in "405 Method not found" in Wildfly and "HPPT status 404" in Tomcat on Android app


I have been struggling with this issue for few days now, and any help / tips would be appreciated.

Using the sample "Greeting" GWT application to check the GWTphonegap PhonegapUtil.prepareService (by adding that line to it) on an Android cordova-based app results in "405 Method not found" when deploying the server-side to Wildfly and "HPPT status 404" when deploying to Tomcat.

The war works correctly on both Wildfly and Tomcat as tested using a web-browser from the android device and local host.

I have debugged the network traffic from the android device to the Wildfly / Tomcat server, and Wireshark confirms that the android app does send the request to the correct address, but the Wildfly / Tomcat server rejects the connection.

What could be the reason for this behavior? Is there a way to debug what is going on with Wildfly / Tomcat and why the RPC is being rejected?


Solution

  • Have you looks at your tomcat logs? I had a similar problem and discovered I was not setting up my base URL correctly for the services I was accessing. I had a GWT project, called Foo, with an application also called Foo using a service called Bar. I setup the request to call service.com:8080/Foo/Bar when in fact I should have been calling service.com:8080/Foo/Foo/Bar.

    The first Foo was referring to the web application name The second Foo was referring the actual application entry point

    1) Check your tomcat logs and see what is actually being called 2) Try hitting the service directly from a Browser and see whether the service responds accordingly (I'm not sure what type of service you need to use -- GET, POST, ???)

    Hope this helps

    J.