Thursday, 22 August 2013

Cannot reach servlets from browser

Cannot reach servlets from browser

I need to deploy a project containing servlets and one index.jps. When I
run it from the IDE ( using intellij ) with external installation of
tomcat7, everything works fine, but as soon as I deploy it on the remote
server, all the Servlet are not reachable.
Here is the structure of the war file that I deploy:
+mywar.war
+META-INF
| +MANIFEST.MF
| +persistence.xml
|
+WEB-INF
| +classes [inside all the classes with the structure]
| +lib [required libraries for hibernate and DB connection]
| +web.xml
|
+index.jsp
The Servlet is defined as follow:
package net.mypackage.servlet;
@WebServlet(name = "GetAccount", urlPatterns = "/GetAccount")
public class GetAccount extends JsonServlet {
...
}
opening from the browser http://servername:8080/mywar returns the
index.jsp, but calling the servlet http://servername:8080/mywar/GetAccount
returns a 404.
I already try to use http://servername:8080/mywar/GetAccount,
http://servername:8080/mywar/net/mypackage/servlet/GetAccount,
http://servername:8080/GetAccount but all of these URLs return a 404.
Did I miss something?
Thank you

No comments:

Post a Comment