Note that there are some explanatory texts on larger screens.

plurals
  1. POGoogle Sample for GWT RPC Returns HTTP Error 405 in Eclipse
    text
    copied!<p>I have been working through the GWT tutorials on Google's developer site, and have gotten to the section on GWT RPC <a href="https://developers.google.com/web-toolkit/doc/latest/tutorial/RPC" rel="nofollow">here</a>. The gist of the problem is that I've followed the instructions on the tutorial carefully, and have encountered a problem when I run the code in development mode on Eclipse Juno. The error is: "Error 405 HTTP method GET is not supported by this URL".</p> <p>The environment I'm in is:</p> <ul> <li>Eclipse Juno 4.2</li> <li>Ubuntu 12.04 LTS (No significant updates recently.)</li> <li>Using default GWT SDK (GWT - 2.4.0).</li> <li>Using default GAE SDK (App Engine - 1.7.2).</li> <li>Chrome Version 21.0.1180.89</li> </ul> <p>Referencing the code in the sample, I've started focusing on the web.xml file and the servlet-mappings in there as a part of the problem. What I have in web.xml code is the following:</p> <pre><code> &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"&gt; &lt;web-app&gt; &lt;!-- Default page to serve --&gt; &lt;welcome-file-list&gt; &lt;welcome-file&gt;StockWatcher.html&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; &lt;!-- Servlets --&gt; &lt;servlet&gt; &lt;servlet-name&gt;stockPriceServiceImpl&lt;/servlet-name&gt; &lt;servlet-class&gt;com.google.gwt.sample.stockwatcher.server.StockPriceServiceImpl&lt;/servlet-class&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;stockPriceServiceImpl&lt;/servlet-name&gt; &lt;url-pattern&gt;/stockwatcher/stockPrices&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;/web-app&gt; </code></pre> <p>The good thing is that the server is finding the code, but somewhere between finding the code and rendering it, it fails.</p> <p>I've researched this problem pretty thoroughly, and I have not found anything that seems to point to the cause of the problem. What I do know is the following:</p> <ol> <li>A better understanding of the HttpServlet class is required.</li> <li>GWT should be taking care of the doPost, and doGet implementations.</li> </ol> <p>If anyone has any suggestions as to what the problem may be, I'm all ears. Or another interpretation of what the error means would be helpful to me and to anyone else having this problem.</p> <h2>EDIT:</h2> <p>I was able to resolve my problem, in part, thanks to Colin Alworth. The problem was how I was thinking about accessing the servlets. Going through the HTML page was indeed the correct way to access the application, and because I was not calling the method that initiates the AsyncCallback method (somehow I missed that), it appeared that the HTML page and the servlet were disconnected.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload