Archive

Posts Tagged ‘Plugin’

How to debug tomcat project in Eclipse 3.4.2

March 20th, 2009

Eclipse is one of the best IDE for software development in java, php, c++ etc.

I recently upgraded my eclipse from 3.3.* and 3.2.* to 3.4.2 and I took this step assuming all my plugins in existing eclipse installation will work as it is. But I have realized that there is huge compatability problem in eclipse upgrades.

I use tomcat for my java web application and to debug it in eclipse I was using tomcat plugin for eclipse. I followed the installation instructions (usually you have to download the plugin, unzip it and copy the uzipped folder to plugins directory in your eclipse_installation_directory) but I was getting this error

java.lang.NoClassDefFoundError: org/apache/tomcat/util/log/SystemLogHandler at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357) at java.lang.Class.getConstructor0(Class.java:2671) at java.lang.Class.newInstance0(Class.java:321) at java.lang.Class.newInstance(Class.java:303) at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:205) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:390)

I tried trouble shooting it using the instructions mentioned here but still no success.

I tried copying the unzipped folder to dropin directory in Eclipse_Installation_Directory still I was getting the same error as above.

Then finally, I tried using standard WTP tool in eclipse 3.4.* and after tweaking some settings I was able to debug my tomcat java project in eclipse. Following are the steps which I did to debug tomcat java project in eclipse 3.4.2 (I guess, it will work in 3.4.*)

1. Install eclipse 3.4.2
2. Start eclipse and go to window –> Show View –> Others –> Server
3. In this view create a right click and create a new server.
4. Please select tomcat installation directory and version information.
5. Then double click on Tomcat VX.X Server at localhost (Name of this server), it opens up configuration settings page
6. In the Server Locations Section select “Use Tomcat Installation (takes control of Tomcat Installation) and enter deploy path (using file browser, point to your tomcat project directory i.e. context path)
7. In the publishing section select Never Publish automatically and uncheck update context path checkbox.
8. Set some breakpoint in your tomcat project’s source code and start tomcat in debugging mode

tomcat-setting-in-eclipse

Hope this helps.

Dipesh Khakhkhar Eclipse, Software , , , ,