Setting up the Sysdeo Tomcat Plug-in

I use the Sysdeo Tomcat Plug-in for Eclipse while doing Java Web Application development.  The main reason I use Sysdeo is that it allows hot-swapping of Java class files without a restart of Tomcat (and without losing Session information, which is the problem with most of the current Eclipse debuggers).  There are limitations of course… you can’t change the interface of a class file without restart, for example.  But for debugging and making hot code changes, Sysdeo is hard to beat.  Sysdeo also allows you to modify JSP files without restart.  And last but not least, it is free. 

You don’t have to use Sysdeo to run the examples on Technological Oddity, but I recommend it for speed of development.

Installing Sysdeo in Eclipse

Note: These instructions are for Eclipse 3.5.1 ("Galileo").  Although they are similar for other versions, some menu options may be in different places for other versions of Eclipse.  I do know that Sysdeo works as far back as the "Europa" build of Eclipse.

Files you will need:

  • Tomcat 5.5.  You will need to download and install Tomcat 5.5.x somewhere on your local system.  Get the latest 5.5.x version (currently, that is version 5.5.28).  You’ll only need to get the "Core" Tomcat package to use with Eclipse. You’ll only need to do this once ever, as you can use the same Tomcat installation for lots of different projects.  Tomcat is easy to install: just unzip it into a directory and you are done.  Remember where you installed it, as this is known as your TOMCAT_HOME (which you will need later).
  • The Sysdeo Tomcat Plug-in for Eclipse.  Currently, the version is 321.  Unzip the files from this package into your ECLIPSE_HOME/plugins directory, and restart Eclipse.  You should see a few buttons on your toolbar with the Tomcat "wildcat" icon.  If you see these buttons, Sysdeo is installed correctly.  In the end, you should have a directory ECLIPSE_HOME/plugins/com.sysdeo.eclipse.tomcat_3.2.1

 SysdeoButtons

  • DevLoader.zip.  This file is included inside the Sysdeo Plug-in ZIP file from above.  Extract it out (or copy it from your local  ECLIPSE_HOME/plugins/com.sysdeo.eclipse.tomcat_3.2.1/DevLoader.zip), then extract the contents of DevLoader.ZIP into your TOMCAT_HOME/server/classes directory.  You’ll need DevLoader.ZIP so that Sysdeo can load your dependencies from inside Eclipse.
  • The Sysdeo-Tomcat-Project.  I’ve created this project to allow different instances of Tomcat to run off the same Tomcat base.  In other words, I import this project into my workspace, and it becomes the Tomcat configuration for that particular workspace (after configuring Sysdeo, see below).  This is NOT another full Tomcat instance.  No matter how many workspaces you use this project in, there is only one c:\tomcat (for example).  To install it, unzip the project into your workspace then import it with File > Import > Project.  This project will make more sense when we configure Sysdeo a bit later.

Configuring Sysdeo in Eclipse

For the sake of instruction, let’s assume the following directories:

  • Tomcat 5.5.28 is installed in C:\tomcat\
  • Your workspace directory is C:\workspace\myworkspace\

These directories are merely examples.  You can put Tomcat or your workspace wherever you want.

Make sure you have installed the files above in the "Installing Sysdeo in Eclipse" section, then start Eclipse.

Go to Window > Preferences.  Select "Tomcat" from the list on the left to bring up the Sysdeo Plug-in settings.

Preferences-Tomcat

Set your Tomcat version to "Version 5.x".  Set Tomcat home to your TOMCAT_HOME directory (c:\tomcat in our example).  Set Context declaration mode to "Context files", and set the Context directory to YOUR_WORKSPACE_HOME\Sysdeo-Tomcat-Project\conf\Catalina\localhost (which in our example is c:\workspace\myworkspace\Sysdeo-Tomcat-Project\conf\Catalina\localhost).  Click "Apply" to save the changes.

Click the dropdown twisty next to Tomcat, then click on Advanced to see the advanced Sysdeo options.

Preferences-Tomcat-Advanced

Change Tomcat Base to YOUR_WORKSPACE_HOME\Sysdeo-Tomcat-Project\  (in our example this is C:\workspace\myworkspace\Sysdeo-Tomcat-Project).  This change allows Tomcat to pick up configuration files (such as the server.xml file) from our project instead of from the normal location of TOMCAT_HOME.  Therefore, we can use the Sysdeo-Tomcat-Project in lots of workspaces without the configurations or applications overwriting each other.

Click "OK" to save the changes and close the Preferences window.

Starting the Tomcat Server

To start the Tomcat Server, click on the "wildcat" icon on the Eclipse toolbar.Start-Tomcat-Button

Tomcat should start, and you should see the log files in your Console window inside Eclipse.  To stop the server, either click the red square ("terminate") on the console window, or click the Stop Tomcat button. Stop-Tomcat-Button

16 thoughts on “Setting up the Sysdeo Tomcat Plug-in”

  1. Tomcat 6 doesn’t have a server/classes directory. Use $TOMCAT_HOME/lib instead.

    Note: I don’t use Tomcat 6, so I can’t verify if Sysdeo works there or not.

  2. Hi,
    well i did as similar as but i having some problem like,server is started but project not noad properly.please send why is not working properly.

    1. Make sure your project is marked as a Tomcat project. You might want to read the HelloWebApp post here (click on the tags, you’ll find it).

  3. Hi,
    I use tomcat 6.0.26 and Eclipse Galileo 3.5.2R35x_v20100210 that comes with SpringSource Tool Suite (STS) 2.3.2.

    I followed meticulously the instructions to install the plugin. The only part that my setup was a bit different was to copy the extract of DevLoader.zip to $TOMCAT_HOME/lib (since tomcat 6.0.26 has no $TOMCAT_HOME/server/classes directories).

    Then, I clicked on the Tomcat start icon. I got the following exception

    java.lang.ClassNotFoundException: org.apache.catalina.startup.Catalina
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:216)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:391)

    I appreciate very much if you could help me rectify the problem.

    Please let me know if you need any additional info.

    Thanks and Best Regards,
    Barry

  4. I am currently installing the plugin for Ubuntu system 11.04 with Eclipse 3.5.2
    The plugin is installed in plugins directory but Eclipse don’t see the plugin in About Eclipse SDK/Installation details
    I have checked that com.sysdeo.eclipse.tomcat_3.3.0 is present in the plugins directory bot it does not work 🙁
    any tips ?

    1. @jmax: I know that later versions of Eclipse (Galileo [3.5.2] and forward) require you to unzip the sysdeo plugin in the $ECLIPSE_HOME/dropins directory instead of the previous $ECLIPSE_HOME/plugins directory. You may want to try that.

      Bob

      1. thanks for your answer. I have no dropins directory in my installation but the/ plugin directory is full of plugins. So I have also created a /dropins directory and unzip the plugin in this directory but nothing happens
        🙁

        1. @jmax Yes, sorry about that. After looking on the Sysdeo plugin page, you are right, 3.5.2 goes in the plugins directory. They have several ideas for troubleshooting if it doesn’t show up after a restart in Eclipse. Have a look near the bottom of the page at http://www.eclipsetotale.com/tomcatPlugin.html

          My best guess is that you need to do one of these two (from the page above):

          Plugin activation for Eclipse 3.x :
          – launch eclipse once using this option : -clean
          – if Tomcat icons are not shown in toolbar : select menu ‘Window>Customize Perspective…>Commands’, and check ‘Tomcat’ in ‘Available command groups’

          I know I used this on Ubuntu with Eclipse 3.5.2 long ago, so it should work. If neither of the above works, look in:

          Your_Workspace_dir/.metadata/.log

          and see if there are any hints there.

          Bob

          1. thans again for your answer but I have, read again and agin ths paragraph.
            So, after running eclipse -clean, no plugin is installed as reported by ‘About Eclipse SDK/Installation details’
            No Tomcat entry in in the menu ‘Window>Customize Perspective…>Commands’
            after many try, I have removed the file /.metadata/.log and now this file is always missing

              1. yes, I am using JDK and my eclipse is running fine since 4 months (edit, debug, run). Eclise has installed a lot of plugins like android dev, …

  5. All,

    Please note that this tutorial is quite old now (but still works pretty good as far as I know). However, there has been a newer version of the Sysdeo plugin released since then (version 3.3) which adds Tomcat 7 support. I’ve been using it for several months and it seems to work great.

    You can download the newest Sysdeo at http://www.eclipsetotale.com/tomcatPlugin.html

    Bob

Leave a Reply

Your email address will not be published. Required fields are marked *