Windows – Tomcat7 Service Cannot Start on Windows 7 Even When It Is Set to Log In as Administrator

tomcatwindows 7

I cannot automatically start the Tomcat7 service at startup on my Windows 7 laptop. On restarting Windows, I get the message "Access is Denied. Unable to Open the Service Tomcat7" even though I have the service set to log in as Administrator.

I've also set the Tomcat directory (which I located outside of the Program Files directories) and all its subdirectories to "Full Control" for all users (which should be overkill). Yet I can start it manually using the "Run as Administrator" context menu item.

If that works, why won't setting it to run as Administrator as a service work?

Best Answer

I was getting the very same error and I managed to sort it out. Though in my case, even though the same error occurred on every start of the machine, the service was running, as I was able to use my app. But I seriously wanted to get rid of this problem so the client will not be forced to see this annoying error.

The way I did it was set up the tomcat7w.exe to always start as an administrator. Exactly you do it in the following way: right click on the tomcat7w.exe which is in the 'bin' folder of the tomcat installation, select 'Properties', then in 'Compatibility' tab under 'Privilege Level' select the 'Run this program as an administrator'.

I have put my answer for completeness as I think this might be the only way for Win 7 Home users, as in this version there is simply no option to set Local Policies which is required in the answer provided by @ta.speot.is (BTW +1)

Related Question