Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

deploy project to Tomcat from Eclipse

I'm trying to deploy a multi-module Maven project from Eclipse to a local Tomcat. The project has the following structure:

root [packaging: pom]
|
|--- domain [packaging: jar]
|
|--- manager [packaging: jar]
|
|--- web [packaging: war]

I import all the projects into Eclipse, then add the "Dynamic Web Module" facet to the web project

enter image description here

In the Runtimes tab of the same dialog, I configure the project to use a (local) Apache Tomcat v6.0 runtime.

I then right-click on the project and choose "Run As -> Run on Server" from the menu. In the following dialog I (again?) choose "Tomcat v6.0 Server"

enter image description here

In the following dialog, I add the web project to the list of configured projects

enter image description here

When I click "Finish", it appears from the console messages that the server has started, but when I go to http://localhost:8080/web/ in a browser I get a 404. I also tried http://localhost:8080/ and that also returns a 404, what am I doing wrong?

like image 443
Dónal Avatar asked Jul 11 '11 21:07

Dónal


1 Answers

Success!!!

When I added the dynamic module Eclipse incorrectly created a WebContent directory. I deleted this directory and made the following change to the file in the .settings directory named org.eclipse.wst.common.component

<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
<!--
<wb-resource deploy-path="/" source-path="/WebContent"/>
-->
like image 152
Dónal Avatar answered Oct 07 '22 16:10

Dónal