user2575502
user2575502

Reputation: 703

Cannot find webapp published by eclipse in tomcat's webapps folder

I created a spring web app project in Eclipse, I can start the webapp from Eclipse and it will show the webpage correctly, but if I type following URL, it reports 404 error:

see below:

enter image description here

but type the URL like this is fine:

enter image description here

and I remember that I should find my web application "SpringMVC" in this folder:

%HOME%\apache-tomcat-8.5.23\webapps    

but I can't see it, I don't know where is my project deployed by eclipse. so, can someone help me explain the reason, is there any configuration I need to do? what is the default folder the web application will be deployed to ?

Upvotes: 0

Views: 2693

Answers (2)

pak
pak

Reputation: 1

Check the tomcat status from your terminal (CTRL-ALT-T from ubuntu) then sudo systemctl status tomcat Eclipse is starting/stopping the tomcat server during project testing so i guess you do not have the tomcat running when you try to access the localhost:8080

Upvotes: 0

vsoni
vsoni

Reputation: 2858

  1. Clearly your application has been deployed with context SpringMVC. Therefore, you need to access your application with url localhost:8080/SpringMVC in your browser instead of localhost:8080.
  2. When you run your application from Eclipse it is deployed in directory .metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps in your workspace directory. There may be some changes in the path depending on the version of eclipse. But try to find *server.core in ./matadata/.plugins directory.

Update

  1. When you run Dynamic WebApplication from eclipse, it will deploy your project to tomcat as a war with default context root as your project name. To change the context root right click on your project, go to properties -> Web Project Settings. Here you can change the context root. Note - you will need to stop the server, clean, publish and then start the server again to make the change into effect.

Upvotes: 1

Related Questions