Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Debugging with Eclipse and Tomcat - deployment issues
Debugging with Eclipse and Tomcat - deployment issues [message #1014433] Mon, 25 February 2013 20:28 Go to next message
Mikkel Lauritsen is currently offline Mikkel LauritsenFriend
Messages: 3
Registered: February 2013
Junior Member
Hi all,

I'm trying some very basic servlet development using Eclipse Juno with WTP, m2eclipse and Tomcat 7.0, but I'm having trouble making debugging work.

What I've done so far is basically as follows, all using the Java EE perspective:

* Create a very simple Maven project called "foo" with packaging=war containing only an index.jsp welcome page
* Right click pom.xml, choose Run As Maven Build..., enter war:war as target and click run. This builds target/foo.war
* Right click project, choose Properties, Project Facets and enable the Dynamic Web Module project facet
* Create a Tomcat server from a local installation
* Right click server, select Add and Remove..., choose foo in the lefthand list and click Add>
* Right click the war file, select Debug As..., choose the default configuration for my Tomcat server

The server starts up and the console output seems fine except for a line that says

WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:foo' did not find a matching property.

Now accessing localhost:8080/foo results in a 404, whereas manually copying the war file to the webapps folder and manually starting Tomcat outside of Eclipse works as expected.

Do I need to do anything else in order to identify foo.war as the artifact that should be deployed when starting debugging, or is something else misconfigured?

Best regards & thanks,
Mikkel Lauritsen
Re: Debugging with Eclipse and Tomcat - deployment issues [message #1014716 is a reply to message #1014433] Tue, 26 February 2013 10:40 Go to previous messageGo to next message
Mikkel Lauritsen is currently offline Mikkel LauritsenFriend
Messages: 3
Registered: February 2013
Junior Member
Replying to myself -

I've checked the Publish module contexts to separate XML files checkbox in the Server Options and that has caused a line saying

INFO: Deploying configuration descriptor <munged>/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/conf/Catalina/localhost/foo.xml

to appear in the console output. This context file points at a completely empty webapp in tmp0/wtpwebapps/foo/ and if I manually copy an index.jsp file there it becomes accessible as locahost:8080/foo/index.jsp .

Is this the proper way of configuring the server, and if yes, how do I make sure that the actual webapp contents are published?
Re: Debugging with Eclipse and Tomcat - deployment issues [message #1014904 is a reply to message #1014716] Tue, 26 February 2013 17:40 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1310
Registered: July 2009
Senior Member
On 2/26/2013 5:40 AM, Mikkel Lauritsen wrote:
> Replying to myself -
>
> I've checked the Publish module contexts to separate XML files checkbox
> in the Server Options and that has caused a line saying
>
> INFO: Deploying configuration descriptor
> <munged>/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/conf/Catalina/localhost/foo.xml
>
>
> to appear in the console output. This context file points at a
> completely empty webapp in tmp0/wtpwebapps/foo/ and if I manually copy
> an index.jsp file there it becomes accessible as
> locahost:8080/foo/index.jsp .
>
> Is this the proper way of configuring the server, and if yes, how do I
> make sure that the actual webapp contents are published?

In Dynamic Web Projects (which is what WTP supports) the contents of the
webapp is defined for the most part on the Deployment Assembly page of
the the project's Properties dialog. If m2eclipse has not configured
this page properly to match how maven is building your webapp, then you
will get a "disconnect" between what WTP thinks is in your webapp and
what maven thinks is in your webapp. I have very little experience with
m2eclipse, so I can't provide much help beyond this.

Cheers,
Larry

P.S. In case it helps, info about the Tomcat support in WTP is found
here: http://wiki.eclipse.org/WTP_Tomcat_FAQ
Re: Debugging with Eclipse and Tomcat - deployment issues [message #1014933 is a reply to message #1014904] Tue, 26 February 2013 21:08 Go to previous message
Mikkel Lauritsen is currently offline Mikkel LauritsenFriend
Messages: 3
Registered: February 2013
Junior Member
Thanks! My initial expectation was that the war file would automatically be deployed since I did Debug As... on it, but I'll try poking at the Deployment Assembly settings and see if I can get things working. So far the icon for the war file has changed slightly, so I'll take that as a good sign.

And thanks for the pointer to the Tomcat FAQ. I've already been through it but AFAIR it doesn't really cover the whole "what actually gets deployed" issue - which I guess isn't surprising since that's not Tomcat specific.

Best regards,
Mikkel Lauritsen
Previous Topic:home and remote inteface will not be created by XDoclet
Next Topic:jetty embedded and multipart/form-data requests
Goto Forum:
  


Current Time: Sun Nov 23 03:56:50 GMT 2014

Powered by FUDForum. Page generated in 0.01906 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software