GWT RPC 失败调用

发布于 2024-12-07 09:01:05 字数 3432 浏览 0 评论 0原文

我收到此错误 -

[WARN] 404 - POST /gwtmaps/mapService (127.0.0.1) 1404 bytes

 Request headers
      Host: 127.0.0.1:8888
      Connection: keep-alive
      User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.186 Safari/535.1
      Accept: */*
      Accept-Encoding: gzip,deflate,sdch
      Accept-Language: en-US,en;q=0.8
      Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
      Content-Length: 163
      Origin: http:/ /127.0.0.1:8888
      X-GWT-Module-Base: http:/ /127.0.0.1:8888/gwtmaps/
      X-GWT-Permutation: HostedMode
      Content-Type: text/x-gwt-rpc; charset=UTF-8
      Referer: http: //127.0.0.1:8888/GWTMaps.html?gwt.codesvr=127.0.0.1:9997
   Response headers
      Content-Type: text/html; charset=iso-8859-1
      Content-Length: 1404

failure


with gwt.xml 文件

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.6.2//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.6.2/distro-source/core/src/gwt-module.dtd">
<module rename-to='gwtmaps'>
  <!-- Inherit the core Web Toolkit 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.clean.Clean'/>-->
  <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                                      -->
<inherits name="com.google.gwt.maps.GoogleMaps" />
<script src="http://maps.google.com/maps?gwt=1&amp;file=api&amp;v=2&amp;sensor=false" />
  <!-- Specify the app entry point class.                         -->
  <entry-point class='com.mymaps.client.GWTMaps'/>
<servlet class = "com.mymaps.server.MapServiceImpl" path="/mapService"/>
  <!-- Specify the paths for translatable code                    -->
  <source path='client'/>
  <source path='shared'/>


和 web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
              http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         version="2.5"
         xmlns="http://java.sun.com/xml/ns/javaee">

 <welcome-file-list>
    <welcome-file>GWTMaps.html</welcome-file>
  </welcome-file-list>

  <!-- Servlets -->
  <servlet>
  <servlet-name>MapService</servlet-name>
  <servlet-class>
    com.mymaps.server.MapServiceImpl
  </servlet-class>
  </servlet>
<servlet-mapping>
  <servlet-name>MapService</servlet-name>
  <url-pattern>/com.mymaps.MapService/gwtmaps/mapService</url-pattern>
</servlet-mapping>

  <!-- Default page to serve -->


</web-app>

有什么想法吗?我不断尝试新的理论,但没有任何成功的理论。

谢谢!

I am getting this error -

[WARN] 404 - POST /gwtmaps/mapService (127.0.0.1) 1404 bytes

 Request headers
      Host: 127.0.0.1:8888
      Connection: keep-alive
      User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.186 Safari/535.1
      Accept: */*
      Accept-Encoding: gzip,deflate,sdch
      Accept-Language: en-US,en;q=0.8
      Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
      Content-Length: 163
      Origin: http:/ /127.0.0.1:8888
      X-GWT-Module-Base: http:/ /127.0.0.1:8888/gwtmaps/
      X-GWT-Permutation: HostedMode
      Content-Type: text/x-gwt-rpc; charset=UTF-8
      Referer: http: //127.0.0.1:8888/GWTMaps.html?gwt.codesvr=127.0.0.1:9997
   Response headers
      Content-Type: text/html; charset=iso-8859-1
      Content-Length: 1404

failure


with my gwt.xml file

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.6.2//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.6.2/distro-source/core/src/gwt-module.dtd">
<module rename-to='gwtmaps'>
  <!-- Inherit the core Web Toolkit 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.clean.Clean'/>-->
  <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                                      -->
<inherits name="com.google.gwt.maps.GoogleMaps" />
<script src="http://maps.google.com/maps?gwt=1&file=api&v=2&sensor=false" />
  <!-- Specify the app entry point class.                         -->
  <entry-point class='com.mymaps.client.GWTMaps'/>
<servlet class = "com.mymaps.server.MapServiceImpl" path="/mapService"/>
  <!-- Specify the paths for translatable code                    -->
  <source path='client'/>
  <source path='shared'/>


and web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
              http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         version="2.5"
         xmlns="http://java.sun.com/xml/ns/javaee">

 <welcome-file-list>
    <welcome-file>GWTMaps.html</welcome-file>
  </welcome-file-list>

  <!-- Servlets -->
  <servlet>
  <servlet-name>MapService</servlet-name>
  <servlet-class>
    com.mymaps.server.MapServiceImpl
  </servlet-class>
  </servlet>
<servlet-mapping>
  <servlet-name>MapService</servlet-name>
  <url-pattern>/com.mymaps.MapService/gwtmaps/mapService</url-pattern>
</servlet-mapping>

  <!-- Default page to serve -->


</web-app>

any ideas? i keep trying new theorys but cant get any to show a success.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

萌无敌 2024-12-14 09:01:05

您可能需要将 @RemoteServiceRelativePath 注释添加到服务的客户端同步接口。

例如:

@RemoteServiceRelativePath("mapService")
public interface MapService extends RemoteService {

...

}

You may need to add the @RemoteServiceRelativePath annotation to the client-side, synchronous interface of your service.

For example:

@RemoteServiceRelativePath("mapService")
public interface MapService extends RemoteService {

...

}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文