1
votes

I made a .war file that prints strings to the console when I run in cmd

java -jar print.war

However, when I deploy this .war file to tomcat 8 by copying the file into the webapps folder:

C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps

I get this error whenever I go to http://localhost:8080/print

Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Mon Dec 19 14:36:59 CST 2016
There was an unexpected error (type=Not Found, status=404).
No message available

Does that mean my deployment failed? Or is there something wrong with my .war file?

Thanks.

1
Without any code it's a bit difficult to tell but I question that you're running a war file on the command line. Are you using a JSP or servlets or are you just creating a main() method? - stdunbar
I'm just creating a main() method. Thanks. - 000000000000000000000
does your war file includes web.xml or javax annotations ? - Shmulik Klein

1 Answers

1
votes

In order to process http request you need to specify a class that extends javax.servlet.http.HttpServlet and provide a deployment descriptor to let your servlet container know where should it delegate specific request.

If those terms are new to you, visit: https://www.tutorialspoint.com/servlets/ for more informations.