unable to make call to service on GWT
i am testing a sample web application on GWT , i have downloaded all SDK, and plugin on eclipse, i have designed a small forms which takes few inputs from user and when user click on button it is making call to service using RPC , now its giving error "
**errorcom.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.mpigeon.foofy.signup.SignUp/SignUpservlet</p><p><i><small><a href="http://jetty.mortbay.org/">Powered by Jetty://</a>**
". i.e it is not connecting to service at all, i am really stuck here kindly help me out to identify the bug. i am sharing the codes below
this is the signup.gwt.xml file
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='foofysignup'>
<inherits name="com.google.gwt.user.User"/>
<inherits name="com.google.gwt.user.theme.standard.Standard"/>
<entry-point class="com.mpigeon.foofy.signup.client.SignUp"/>
<source path='client'/>
<source path='shared'/>
</module>
web.开发者_如何学运维xml
<?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>
<!-- Servlets -->
<servlet>
<servlet-name>fsignup</servlet-name>
<servlet-class>com.mpigeon.foofy.signup.server.SignupServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>fsignup</servlet-name>
<url-pattern>/foofysignup/SignUpservlet</url-pattern>
</servlet-mapping>
<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>SignUp.html</welcome-file>
</welcome-file-list>
</web-app>
service file interface :
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.mpigeon.foofy.signup.shared.SignUpFields;
@RemoteServiceRelativePath("SignUpservlet")
public interface SignupService extends RemoteService {
public String StoreSignUp(SignUpFields obj) throws IllegalArgumentException;
}
signup.html
<!doctype html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!-- -->
<!-- Consider inlining CSS to reduce the number of requested files -->
<!-- -->
<link type="text/css" rel="stylesheet" href="SignUp.css">
<!-- -->
<!-- Any title is fine -->
<!-- -->
<title>Wrapper HTML for SignUp</title>
<!-- -->
<!-- This script loads your compiled module. -->
<!-- If you add any GWT meta tags, they must -->
<!-- be added before this line. -->
<!-- -->
<script language="javascript" src="/com.mpigeon.foofy.signup.SignUp.nocache.js"></script>
</head>
<!-- -->
<!-- The body can have arbitrary html, or -->
<!-- we leave the body empty because we want -->
<!-- to create a completely dynamic ui -->
<!-- -->
<body>
<!-- OPTIONAL: include this if you want history support -->
<iframe id="__gwt_historyFrame" style="width:0;height:0;border:0"></iframe>
<div id="signupdiv"></div>
</body>
</html>
If you replace
@RemoteServiceRelativePath("SignUpservlet")
with
@RemoteServiceRelativePath("../foofysignup/SignUpservlet")
the rpc request should work. This is not a good solutions but it works at least.
As Terrell pointed out you app is loading from /com.mpigeon.foofy.signup.SignUp/
but due to your rename-to attribute your app should be loaded from /foofysignup/
. This may be caused by old files in you WebContent folder.
Could you post your SignUp.html?
Have you done a GWT Compile since adding <module rename-to='foofysignup'>
to your gwt.xml?
From this error it appears that your app expects the servlets to be mapped under the default fully qualified module name : RequestURI=/com.mpigeon.foofy.signup.SignUp/SignUpservlet
精彩评论