The case of the annoying Tomcat 6 Monitor

Ever since installing Tomcat 6 on my Windows 7 machine at home I’ve had an annoying message box pop up every time I restart my machine: Access is denied. Unable to open the service ‘Tomcat6′. Since it takes less time and effort to click on OK than to sort out the problem that is exactly what I have been doing … but enough is enough.

Access is denied

Tomcat IS running – so what is causing this error?

I confirmed that the Tomcat 6 service was running even though I got this message box – so what was causing it ? It turns out that Tomcat 6 Monitor Application was causing this error. Tomcat 6 Monitor Application is a GUI for monitoring and configuring the Tomcat 6 Service. It needs to be executed by the Administrator user and the UAC is getting in the way at start up time.

Are you feeling brave ?

The only solution I have found to work so far is to remove the Tomcat 6 Monitor Application from the Windows startup. And the only way to do this is to remove a registry entry …

Fire up regedit (Start Menu > Search programs and files > regedit.exe) and remove the following key:

  • Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

567

Now you should not see this annoying message box every time Windows starts up. But it also means that Tomcat 6 Monitor will not be started on Windows startup.

Running Tomcat 6 Monitor manually

You may still want to run the Tomcat 6 Monitor since it does provide nice shortcuts for configuring and monitoring the state of your Tomcat 6 service. You can execute the Tomcat 6 Monitor via Run as administrator or you can configure the shortcut in the Start Menu to always execute the application as administrator.

Find the shortcut to the Tomcat 6 Monitor in the Start Menu (Start Menu > Apache Tomcat 6.0 > Monitor Tomcat) and right-click on it. Select Properties.

2

Click on the Shortcut tab in the Monitor Tomcat Properties window. Click on the Advanced button and check the Run as administrator checkbox.

3

Click Continue on the Dialog that pops up and now you should be able to start the Tomcat 6 Monitor by simply clicking the shortcut in the Start Menu. Windows will still flash the UAC though since you are running this application as administrator.

4

Update: 05 December 2010

The comment by Scot shows once again that there is always more than one way to skin a cat. Thanks Scot.

If you would still like to have the Apache Tomcat Monitor fired up on startup then replace the steps in this post with the following:

  • Leave the registry key ApacheTomcatMonitor at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run untouched. This will ensure that Windows starts up the Tomcat Monitor.
  • Right click on the tomcat6w.exe executable found at %CATALINA_HOME%\bin. Click on the Properties menu item and then select the Compatibility tab. Check the Run this program as an administrator checkbox under the Privilege Level section. Click the OK button.

Run as administrator

When Windows starts up now you will no longer get the Access is denied. Unable to open the service ‘Tomcat6′ message. The UAC will pop up and ask you to confirm the starting of the Apache Tomcat Monitor.

About these ads

16 thoughts on “The case of the annoying Tomcat 6 Monitor

  1. If you right-click on tomcat6w.exe located in %CATALINA_HOME%\bin, choose Properties from the popup menu, and select “run as administrator” located at the bottom of the Compatibility tab, you will get a UAC popup at logon but not the failure.

    If more than one logged in user will need to load the monitor, use the button to access settings for all users right below the checkbox described above.

    Turning off UAC works nicely but I like to keep it on just for that added layer of security.

  2. Registry entry of the Apache Monitor under Windows7:
    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
    Exact name of the key:
    ApacheTomcatMonitor7.0_Tomcat7

  3. Honestly speaking very useful for novice and thanks a lot for such a useful post…
    If you don’t mind can you also tell me how to configure multiple instances of tomcat in single machine on windows 7?

    • You’ll need to download the non Windows Service installer. Look at the plain Windows zip file download. Unzip to two or more folders and then configure the tomcats to run on different ports. Use the startup and shutdown scripts in the bin folder.

  4. U can also set registry
    HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
    New key REG_SZ with Name (path+filename to file tomcat6w.exe)
    set Data to RUNASADMIN

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s