I created a servlet for my GWT app made with eclipse. When I deploy it in TOMCAT works perfectly, but in Glassfish I have an 404 Error.
I have no deploy errors, the main html page loads well. But anything that use the RPC servlet gives me this error:
com.google.gwt.user.client.rpc.StatusCodeException: 404 Not Found
HTTP Status 404 - Not Found
type Status report
messageNot Found
descriptionThe requested resource is not available.
GlassFish Server Open Source Edition 4.1
My web.xml is like this:
<?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>testServlet</servlet-name>
<servlet-class>com.test.server.testServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>testServlet</servlet-name>
<url-pattern>/webclient/test</url-pattern>
</servlet-mapping>
<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>Webclient.html</welcome-file>
</welcome-file-list>
</web-app>
In the stub for the RPC I have this com.test.client.testService :
@RemoteServiceRelativePath("test")
public interface testService extends RemoteService {
And the servlet:
public class testServiceImpl extends RemoteServiceServlet implements testService
Notes:
When the app runs in tomcat, if I write the servlet name in the URL it shows me this error:
localhost:8080/webclient/webclient/test
Status HTTP 405 - Method HTTP GET is not supported in this URL
It seems that in fact is loaded well. But when is in Glassfish:
HTTP Status 404 - Not Found
What i'm missing? Thanks!
/webclient/testin web.xml, but onlytestinRemoteServiceRelativePath. Could you try to set both totestand openlocalhost:8080/webclient/test? Also, is the context pathwebclienton both Tomcat and Glassfish? - Uooo