Eclipse GWT sample greeting project RPC failure

I have been working with Eclipse for a little while now but all of a sudden my GWT projects don't run anymore when I (after compiling) copy the the content of the 'war' folder to my 'Sites' folder on the mac. This was working absolutely fine but now I keep getting an RPC Failure -

An error occurred while attempting to contact the server. Please check your network connection and try again.

在这里输入图像描述

I am simply creating new Google Web Application projects now (they have the greeting sample build in) and this still works well when I am within Eclipse running either Debug or Run (using the Jetty then be default) but NOT when I copy the war over to the sites.

EDIT - As per the recommendations I have now ported the app to Tomcat7 where it works fine. I am still puzzled as to why it was working on the mac but am now happy with the configuration.

Appengine version:1.7.2
GWT version:2.4.0
Eclipse version:4.2(juno) Java SE 6 (MacOS X)

Any help much appreciated!


The 'Sites' folder on your Mac allows the contents to be served up using the Apache Web Server (http://httpd.apache.org/), which is smart enough to hand out files, and to know how to talk to various 'modules' that can run applications on the server. That said, no file served out of your user's Sites folder will be run as an application, at least with the default configuration.

Additionally, the default sample project is written in Java, and meant to be run on a Servlet Container. There are many servlet containers out there (Tomcat, Jetty, JBoss), but the Apache HTTP Server isn't one of them. I've never heard of a servlet container that runs as a module for apache, though there is at least one module out there that allows apache to easily talk to Tomcat.

So as a result, you are seeing the static content - the html, the compiled JavaScript, the styles and images - but when the sample app attempts to communicate with the server, it fails, because apache isn't really designed to run the server pieces of the sample application. Instead, consider downloading a copy of Tomcat or Jetty, and copying the war folder into their webapps/ directory, and serving from there.

链接地址: http://www.djcxy.com/p/24276.html

上一篇: gwt mvp联系人示例项目在eclipse中导入时出错

下一篇: Eclipse GWT示例问候项目RPC失败