0
votes

I am reading "Java Webservices: Up and Running" to study for my OCE WSD certification. I installed Apache Tomcat 7.0.54 and am able to view the Tomcat homepage at localhost:8080. I am in chapter 1 of the mentioned book and have built my first project with the .war deployed into ..\apache-tomcat-7.0.54\webapps\MyWebservice.war. I installed CURL to try a simple ping with...

curl -v http://localhost:8080/predictions/

I am getting 404 error: Not found. I also get this while using my web browser to view the same URL. I thought that since my .war file was deployed into my apache tomcat 'webapps' folder, simply starting the Tomcat server would pick up that .war file and start the webservice. Any ideas what I might be doing wrong or steps I might have missed to start my webservice?

Edit for Solution:

curl -v http://localhost:8080/MyWebservice/

2

2 Answers

1
votes

check the name of the application mentioned in the web.xml.

If web.xml is not present, the name of the application would be the name of the war.

Tomcat maintains hierarchy where the servlets are of the scope of the application.

Try using

http://<>:8080/<>

it should return you something. If it does, then try adding the servlet name.

hope it helps.

-1
votes

Probably you want http://localhost:8080/MyWebservice/predictions/ since Tomcat deploys War files the context name equal to the War file you use.