On Feb 27, 2013, at 7:36 AM, Rune Stilling wrote:

> Hi André
> 
> Thanks for an excellent summary. There's one thing that I haven't been 
> precise enough about I can see.
> 
> I CANNOT run Tomcat via the RS-parameter:
> 
> Tomcat7.exe //RS/Tomcat7
> 
> If I try the log produces the following:
> 
> [2013-02-27 14:33:55] [info]  [548184] Commons Daemon procrun (1.0.13.0 
> 64-bit) started
> [2013-02-27 14:33:55] [info]  [548184] Running 'Tomcat7' Service...
> [2013-02-27 14:33:55] [error] [548184] StartServiceCtrlDispatcher for 
> 'Tomcat7' failed
> [2013-02-27 14:33:55] [error] [548184] The service process could not connect 
> to the service controller.
> [2013-02-27 14:33:55] [error] [548184] Commons Daemon procrun failed with 
> exit value: 4 (Failed to run service)
> [2013-02-27 14:33:55] [error] [548184] The service process could not connect 
> to the service controller.

This is expected. Per Microsoft's website [1] you cannot run services 
interactively from the command line. (You can start them from the command line, 
i.e. with `sc start`, but you cannot run them from the command line, i.e. with 
`Tomcat7.exe //RS/Tomcat7`.) This is why from the command line it works with 
`Tomcat7.exe //TS/Tomcat7` ... that command tells Tomcat to not attempt to 
connect to the service controller.

"The service process could not connect to the service controller" in this case 
is unrelated to the fact that you can't start the Tomcat service from the 
service controller. If you got this message when you tried to start the Tomcat 
service normally, then I would be worried.

One thing I would point out is that your JAVA_HOME environmental variable is 
not correct. This should NOT affect Tomcat when it is running as a service, as 
far as I know. JAVA_HOME should be the home directory of a JDK (e.g., 
C:\Program Files\Java\jdk7) and JRE_HOME should be the home directory of a JRE 
(e.g., C:\Program Files\Java\jre7). Your JRE_HOME is correct, but your 
JAVA_HOME is C:\Program Files\Java. Again, this doesn't matter when Tomcat is 
run as a service. Also, Tomcat only NEEDS a JRE_HOME (and only when running not 
as as service), it does not NEED a JAVA_HOME. But if you have a JAVA_HOME, it 
should be correct.

I've encountered and solved hundreds of Tomcat-as-a-Windows-Service problems 
before, but I have never seen Tomcat not log anything. If you don't mind, could 
you run Tomcat7w.exe, screenshot each tab (Alt + Print Screen gets a screenshot 
for just the window instead of the whole thing), put the screenshots online 
somewhere public, and then post links to the screenshots here? My money is on 
finding something amiss there.

Question: When you run the service installer, it installs Tomcat at C:\Program 
Files\Apache Software Foundation\Tomcat 7.0, correct? (Unless, of course, you 
changed it at install time.)

Question: I know at some point you said this, but I can't find the email 
anymore. Can you remind me what version of Windows you are running on?

[1] http://msdn.microsoft.com/en-us/library/ms686324(VS.85).aspx

> 
> What I CAN do is to run it via the TS-parameter:
> 
> Tomcat7.exe //TS/Tomcat7
> 
> But - I'll try what you suggested anyways.
> 
> /Rune
> 
> Den 27/02/2013 kl. 14.20 skrev André Warnier <a...@ice-sa.com>:
> 
>> Rune Stilling wrote:
>>> Is there some registry key I could check related to the installation 
>>> process?
>> Call up the Registry Editor, and search for "tomcat7".
>> 
>> You should find essentially 2 places :
>> 
>> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tomcat7
>> (under this one, you will find the parameters which Windows needs to know 
>> about the service (such as, how to start it) ("it" being "tomcat7.exe")
>> 
>> HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\....
>> (under this one, you will find the parameters which "tomcat7.exe" (the 
>> "service wrapper") needs to know (such as, which JVM to start and with which 
>> parameters)
>> 
>> (and remember, tomcat7.exe is a renamed "prunsrv.exe", which is one of the 2 
>> modules that are part of "procrun").
>> 
>> ------------------
>> 
>> Let's step back a bit.
>> 
>> 1) you install Tomcat on the machine, using the "Windows installer" package 
>> from tomcat.apache.org.
>> 
>> 2) this installer creates the Registry value :
>> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tomcat7\ImagePath = 
>> "C:\apache-tomcat-xxxx\bin\tomcat7.exe //RS//Tomcat7"
>> (or similar)
>> This Registry value is the one that will be used by the Windows Service 
>> Manager, to know which program to launch when you click on "Services.. 
>> Tomcat7...start".
>> 
>> 3) when you login as a user onto the machine, open a command window, and run 
>> the above command ("C:\apache-tomcat-xxxx\bin\tomcat7.exe //RS//Tomcat7"), 
>> the tomcat7.exe program runs, and starts a JVM which starts Tomcat, as a 
>> Service.
>> And that works fine, tomcat logs are produced etc.
>> 
>> 4) when instead, you open the Windows Service Manager dialog, and ask 
>> Windows to start the Tomcat service, nothing happens.
>> (Tomcat does not start, tomcat7.exe does not run, no logs are produced etc.)
>> 
>> So the intuitive conclusions would be :
>> - there is nothing wrong with Tomcat per se.  Otherwise, it would not run, 
>> no matter how it is started.  There is also nothing wrong with the JVM, for 
>> the same reasons.
>> - there is nothing wrong with the Registry parameters of "tomcat7.exe" (the 
>> ones found under "HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation").  
>> Otherwise, in case (3) above, tomcat7.exe would not be able to start the JVM 
>> etc..
>> 
>> So there must be something wrong with the parameters used by the Windows 
>> Service Manager when it tries to start the Tomcat service. (The ones under 
>> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tomcat7\)
>> 
>> What that would be, I couldn't say, and certainly not without access to your 
>> Registry.
>> 
>> But what I would do at this stage is this :
>> 
>> 1) de-install Tomcat again (do not delete the installer.exe file that you 
>> downloaded, you'll need it again)
>> 2) using the Registry Editor (carefully), go to the key 
>> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tomcat7\, and delete it 
>> (and everything under it).
>> 3) reboot Windows, and with the Registry Editor, verify that the key is 
>> still deleted
>> (I am saying that because who knows what MS will have invented yet to 
>> re-instate things that you deleted..)
>> 4) re-install the Tomcat service by re-running the installer
>> 5) try again to start Tomcat
>> 
>> and tell us what happens.
>> 
>> 
>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to