GWT RPC getting 404 error

1,409 views
Skip to first unread message

azuniga

unread,
Mar 8, 2011, 10:30:38 AM3/8/11
to Google Web Toolkit
I am rather new to GWT and I'm attempting to get RPC working. I am
getting the following error:
[WARN] 404 - POST /com.gwt.ReportGeneration.ReportGeneration/report
(127.0.0.1) 1434 bytes
Request headers
Host: 127.0.0.1:8888
User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:
1.9.2.13) Gecko/20101203 Firefox/3.6.13
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/
*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Referer: http://127.0.0.1:8888/ReportGeneration.html?gwt.codesvr=127.0.0.1:9997
Cache-Control: no-cache
X-GWT-Permutation: HostedMode
X-GWT-Module-Base: http://127.0.0.1:8888/com.gwt.ReportGeneration.ReportGeneration/
Content-Type: text/x-gwt-rpc; charset=utf-8
Content-Length: 212
Pragma: no-cache
Response headers
Content-Type: text/html; charset=iso-8859-1
Content-Length: 1434
com.google.gwt.user.client.rpc.StatusCodeException: 404 <html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1"/>
<title>Error 404 NOT_FOUND</title>
</head>
<body><h2>HTTP ERROR: 404</h2><pre>NOT_FOUND</pre>
<p>RequestURI=/com.gwt.ReportGeneration.ReportGeneration/report</
p><p><i><small><a href="http://jetty.mortbay.org/">Powered by
Jetty://</a></small></i></p><br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>

</body>
</html>

at
com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:
192)
at
com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:
287)
at com.google.gwt.http.client.RequestBuilder
$1.onReadyStateChange(RequestBuilder.java:395)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:
103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:
71)
at
com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:
157)
at
com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:
326)
at
com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:
207)
at
com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:
126)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:
561)
at
com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:
269)
at
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:
91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:214)
at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:
103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:
71)
at
com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:
157)
at
com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:
281)
at
com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:
531)
at
com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:
352)
at java.lang.Thread.run(Thread.java:619)

I don't know where my error is but I know when I make my rpc call, it
always fails, the error is thrown at the line onFailure(Throwable
caught). Here is my .gwt.xml file:
<?xml version="1.0" encoding="UTF-8"?>

<module rename-to='reportgeneration'>

<!-- Inherit the core gwt stuff -->
<inherits name='com.google.gwt.user.User'/>

<!-- Inherit the default GWT style sheet. You can change -->
<!-- the theme of your GWT application by uncommenting -->
<!-- any one of the following lines. -->
<inherits name='com.google.gwt.user.theme.standard.Standard'/>
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->

<!-- Other module inherits -->

<!-- Specify the entry point for the class -->
<entry-point class='com.gwt.ReportGeneration.client.ReportGeneration'/
>

<!-- Specify the paths for translatable code -->
<source path='client'/>
<source path='shared'/>
</module>

and this is what my web.xml file looks like:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>ReportGeneration.html</welcome-file>
</welcome-file-list>

<servlet>
<servlet-name>repGenSvcImpl</servlet-name>
<servlet-
class>com.gwt.ReportGeneration.server.ReportGenerationServiceImpl</
servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>repGenSvcImpl</servlet-name>
<url-pattern>/reportgeneration/report</url-pattern>
</servlet-mapping>

</web-app>

Any help is greatly appreciated.

Erik Bens

unread,
Mar 8, 2011, 11:24:32 AM3/8/11
to Google Web Toolkit
Hi,

this site is called: /com.gwt.ReportGeneration.ReportGeneration/
report
your handling this site: <url-pattern>/reportgeneration/report</url-
pattern>

Regards

azuniga

unread,
Mar 8, 2011, 11:44:37 AM3/8/11
to Google Web Toolkit
Thank you, I thought that the rename-to in the .gwt.xml would allow me
to reference it in that manner, but once I changed it to /
com.gwt.ReportGeneration.ReportGeneration/report it worked. Now I
gotta get the RPC's to work. Thanks again Erik.
Reply all
Reply to author
Forward
0 new messages