1

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.

enter image description here

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!

Marcel
  • 2,148
  • 6
  • 31
  • 48

1 Answers1

1

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.

Colin Alworth
  • 17,801
  • 2
  • 26
  • 39
  • Thanks for that Colin - however, it doesn't explain that initially all sample projects I did (including the famous StockWatcher) was fully working using the mechanism I described above (the default mac server)... In fact, I still have a previously compiled version that still works well!! So whilst I take your point on your comment and I will certainly try I do still find it very puzzling to say the least. I have the feeling I have inadvertently altered a setting and now this is the consequence. But what can I do to get this back to what it was? :) – Marcel Sep 28 '12 at 07:59
  • @Marcel your compiled WAR will never run outside a servlet container (Tomcat, Jetty, etc.) and IIS on Windows isn't one of them either! read more about Java Servlets and the like to understand how to deploy your project. – Alonso Dominguez Sep 28 '12 at 09:36
  • Thanks for that - I completely take your point on this - I have just now installed Tomcat7 on my windows machine and have copied the war folder in the webapps and it now is working! Again - thanks to both of you for your assistance. – Marcel Sep 28 '12 at 10:00