user1415853
user1415853

Reputation: 81

GWT works on localhost, but shows 404 on remote tomcat

I use eclipse's GWT toolkit to compile my project. And I deploy it in my localhost, it works. But when I upload it to a remote tomcat, it shows 404. I use GWT.getHostPageBaseURL() to get the host URL. In the local tomcat, url is localhost:8080/M/M.html. In the remote tomcat, it is http://p.i.edu:8080/M/M.html

Upvotes: 0

Views: 587

Answers (2)

Ryan Xu
Ryan Xu

Reputation: 19

I have the same problem.what is worse,my project delopyed can not start at all.When I check it by tomcat manager,I got the negative infos as below: FAIL - Application at context path /GwtTest could not be started FAIL - Encountered exception org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/GwtTest]]

Several days before ,I deploy a similar one (without any changes just creating it by Eclipse)successfully to the same remote tomcat. I checked the project files carefully,and now confirm the cause is in web.xml.I defined a servlet in it,but the remote tomcat seems to be unknown it.After change the server-class's content to any(even wrone),the 404 is gone,but the servlet can not work! while on local windows tomcat,the servlet works fine!

Upvotes: 1

Java SE
Java SE

Reputation: 2073

You can use:

GWT.getModuleBaseUrl(); 

It will return you the complete url your are looking for. I hope this will solve your problem.

Upvotes: 0

Related Questions