Hello!
My gwt app that uses mysql database runs normaly in eclipse when debugging. When i run it on tomcat, it displays correctly but when i click on a button that makes a RPC (executes servlet and contacts the database) i get an error. I checked my tomcat log and i see 404 error when clicking on a button:
0:0:0:0:0:0:0:1 - - [22/Jul/2010:10:32:39 +0200] "GET /Bazica/war/Bazica.html HTTP/1.1" 304 -
0:0:0:0:0:0:0:1 - - [22/Jul/2010:10:32:39 +0200] "GET /Bazica/war/Bazica.css HTTP/1.1" 304 -
0:0:0:0:0:0:0:1 - - [22/Jul/2010:10:32:39 +0200] "GET /Bazica/war/bazica/bazica.nocache.js HTTP/1.1" 304 -
0:0:0:0:0:0:0:1 - - [22/Jul/2010:10:32:39 +0200] "GET /Bazica/war/bazica/ F0C186B415ADBD43522C686552368517.cache.html HTTP/1.1" 304 -
0:0:0:0:0:0:0:1 - - [22/Jul/2010:10:32:39 +0200] "GET /Bazica/war/bazica/gwt/standard/images/hborder.png HTTP/1.1" 304 -
0:0:0:0:0:0:0:1 - - [22/Jul/2010:10:33:29 +0200] "POST /Bazica/war/bazica/greet HTTP/1.1" 404 1024
I guess this is a problem with web.xml file and url-pattern. I guess i don't understand this url-pattern, where should it point to?
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>greetServlet</servlet-name>
<servlet-class>com.test.baze.server.GreetingServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>greetServlet</servlet-name>
<url-pattern>/bazica/greet</url-pattern>
</servlet-mapping>
<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>Bazica.html</welcome-file>
</welcome-file-list>
</web-app>
My interface has an annotation RemoteServiceRelativePath("greet"), i think it's relevant:
package com.test.baze.client;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
/**
* The client side stub for the RPC service.
*/
@RemoteServiceRelativePath("greet")
public interface GreetingService extends RemoteService {
String greetServer(String name) throws IllegalArgumentException;
}
I tried changing url-pattern to the folder of my service implementation /WEB-INF/classes/com/test/baze/server but my app hangs with no message. Could you please help me change my web.xml or sth. else to get my app working on a Tomcat. Tnx.