Sunday, December 18, 2005

Tomcat port monitoring in Eclipse Web Tools Platform (WTP)

For Eclipse WTP 0.7, that is the way to make the TCP/IP monitoring work. First of all, the monitors are defined in Windows -> Preferences -> Run/Debug -> TCP/IP Monitor. It is NOT the monitor menu from the Tomcat context menu. That ones are other monitors, don't mix them both.

In the TCP/IP Monitor preferences windows, define a HTTP monitor for your Tomcat port. In my case, I use the default one (8080), so I defined a monitor for localhost:8080 traffic (and set the local port to 6666, but it could have been any available port). Start this monitor.

After that, you may start your Tomcat. The TCP/IP monitor is independent of the start of your Tomcat (independent of being up or down). In order to monitor your web services, instead of sending your web services request directly to your Tomcat deployed web services, you must define a new endpoint (to the port you defined in the above step) and send your web services request to this port. That could be done by the JSP files generated by Eclipse or by the Web Services Explorer.

Finally, open the view "TCP/IP Monitor" and start monitoring all the HTTP traffic.

Note that you don't need to change your Tomcat startup parameters, define JMX monitoring and other complex stuff. Simply do the above steps and everything will be working.

What I still don't know is why Eclipse, during a bottom-up web services creation, complains that the Tomcat configuration does not support port monitoring. Actually, it does not even make the slightest sense for me, since it is a independent service. If you have further information about this, please let me know.
Post a Comment