AbdulAziz
AbdulAziz

Reputation: 6278

Exporting maven project from eclipse and its deployment on tomcat

I am using this tutorial and I did all the steps according to it. But I am stuck to the very end step that is

Build the project and deploy the war file in Tomcat. Start Tomcat and hit below URL.

URL: http://localhost:8080/springDemo-1.0/welcome.do

I done 'build project' in eclipse and I export the project as .war file to webapps of tomcat, but when I use the URL it says "HTTP Status 404" and "The requested resource (/springDemo-1.0/welcome.do) is not available." Please help

Upvotes: 2

Views: 3428

Answers (2)

Snowy Coder Girl
Snowy Coder Girl

Reputation: 5518

Maybe try manually loading the project into Tomcat. Go to http://localhost:8080 and click on "Tomcat Manager". At the bottom, upload your WAR and hit "Deploy". You should then be able to click on the link in the table, add the "/welcome.do", and see your page.

If you are denied access to the Tomcat manager, you might have to update the tomcat-users.xml in your Tomcat's conf folder (for example, see below).

<role rolename="manager-gui" /> 
<user username="admin" password="password" roles="manager-gui" />

With the above, you can access the manager using admin/password.

Upvotes: 1

MariuszS
MariuszS

Reputation: 31567

Better is to use m2e-wtp plugin for eclipse

Update site http://download.jboss.org/jbosstools/updates/m2eclipse-wtp/

After install update maven configuration (Maven -> Update Configuration). Now you can simple add WAR project to Tomcat instance configured in Eclipse WTP.

More about using this -> https://docs.sonatype.org/display/M2ECLIPSE/WTP+mini+howto

Upvotes: 1

Related Questions