1

1) Installed GWT and Eclipse on Mac

2) Created a GWT project (2.4) with generated code called Hello

3) Ran the project on local computer (in dev mode) and it works as expected.

4) Compile the project and upload the war directory to my account hosted by serversanddomains.com

  • The production front end works fine, but when I try the RPC request I get the following error.

com.google.gwt.user.client.rpc.StatusCodeException: 404 Not Found The requested URL /hello/greet was not found on this server.

I tried compiling with different versions of java as suggest by How to use GWT - RPC to Tomcat server

Serversanddomains.com currently runs Tomcat and java 1.6.0_29

I asked to see the error log and they responded Here is the error we are seeing in the error log: File does not exist: /home/username/public_html/hello/greet, referer: http://mydomain.com/Hello.html And in the /usr/local/jakarta/tomcat/logs/catalina.out log file no reports of anything.

My web.xml file is:

<?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">


  <!-- Servlets -->
  <servlet>
    <servlet-name>greetServlet</servlet-name>
    <servlet-class>com.hello.server.GreetingServiceImpl</servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>greetServlet</servlet-name>
    <url-pattern>/hello/greet</url-pattern>
  </servlet-mapping>

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

</web-app>

Any suggests would be welcome.

Cheers

2 Answers 2

1

As a rule of thumb, shared hosting accounts are usually just apache virtual hosts. Apache is just a web server. To host a GWT app that uses RPC, you need an application server, like Tomcat, Jetty (used by GWT Dev Mode), GlassFish and others.

You will NEVER be able to do that from a shared hosting account, because it's just not possible. You need to get a VPS dedicated server and set everything up yourself, usually.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you, I contacted the provider and you are correct. I will have to update the package I have. Cheers
0

It looks like your server is not set up to be a servlet container. It does not know how to serve /hello/greet, which your GWT app defines in web.xml.

You should ask your host if they offer hosting that supports this sort of java servlet environment.

1 Comment

Thank you Riley, I just sent a ticket to serversanddomains.com and will let you know the response.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.