You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by David Rush <da...@rushtone.com> on 2011/10/14 14:02:57 UTC
Tomcat 7 won't run as Windows service
I've been running Tomcat 6.0.18 for a long time, and am now trying to
upgrade to 7.0.22 (64 bit .zip download).
I can start Tomcat 7 with startup.bat and it's working fine.
The script to install it as a service worked without complaint, and the
service is there.
However when I try to start it I get "Error 1067: The process terminated
unexpectedly".
commons-daemon.2011-10-14.log says: [error] FindClass
org/apache/catalina/startup/Bootstrap failed
I'm using Java 7 JDK (1.7.0, 64 bit), JAVA_HOME points to the JDK
installation, and Java's "bin" is in my system path, on my Windows 7
machine.
I'm using the setenv.bat in tomcat\bin that I copied from my Tomcat 6
installation, which explicitly sets JAVA_HOME (which technically may not
be necessary since I have JAVA_HOME env var set to the same value, but I
need to have the option to support more that one JVM on my development
box). I've added a debug statement in setenv.bat that echoes something
to a file. When I run startup.bat, I get the echoed output. When I try
to start the service, I do not.
Help?
David
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Tomcat 7 won't run as Windows service
Posted by Pid <pi...@pidster.com>.
On 15/10/2011 22:46, David Rush wrote:
> No, I did not uninstall the old service. I'd like to be able to keep
> multiple Tomcat instances going at once. Normally I do keep multiple
> instances, each installed as a service (on different ports with
> different service names), but they've always been of the exact same
> version.
It was not clear to me whether you were adding a service or replacing it.
> Would there be an issue with different Tomcat versions installed at once?
There shouldn't be.
> On my development box I did get the Tomcat Windows service to run after
> moving back to Java 6.
>
> But my last attempt to install and run a Windows service on our staging
> machine is now failing to run as a service as well, although I'm not
> getting the commons-daemon error like before. Again I can run it fine
> from startup.bat, and can install the service, but starting the service
> fails. Nothing notable in stdout or stderr logs, either. Event viewer
> says "The david2 Tomcat 7 service terminated with service-specific error
> 0 (0x0)." Bah.
>
> What exactly is needed for the Tomcat bootstrapping to "find" the Java
> install that it's to use?
The service wrappers, e.g tomcat7w.exe, have a control panel with
various tabs & properties therein.
You must either run that program with a parameter so it knows which
service to refer to, or make a copy with the same name as the service,
e.g. david7w.exe and then run it.
I thought that setting JAVA_HOME in
> setenv.bat was a way, but apparently that's not used when it runs as a
> service.
See above, and:
http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html
Use the popup to select the Java version you wish to run.
p
Is it a matter of having JAVA_HOME set at the time that the
> service is created, and it "keeps" that value in the service
> configuration somehow? Or does the JAVA_HOME env var have to be set in
> the environment of the service that's trying to run, every time it starts?
>
> David
>
> On 10/15/2011 10:31 AM, Pid wrote:
>> On 14/10/2011 13:16, Konstantin Kolinko wrote:
>>> 2011/10/14 David Rush<da...@rushtone.com>:
>>>> I've been running Tomcat 6.0.18 for a long time, and am now trying to
>>>> upgrade to 7.0.22 (64 bit .zip download).
>>>>
>>>> I can start Tomcat 7 with startup.bat and it's working fine.
>>>>
>>>> The script to install it as a service worked without complaint, and the
>>>> service is there.
>> Did you uninstall the old service first?
>>
>>
>> p
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
Re: Tomcat 7 won't run as Windows service
Posted by David Rush <da...@rushtone.com>.
No, I did not uninstall the old service. I'd like to be able to keep
multiple Tomcat instances going at once. Normally I do keep multiple
instances, each installed as a service (on different ports with
different service names), but they've always been of the exact same version.
Would there be an issue with different Tomcat versions installed at once?
On my development box I did get the Tomcat Windows service to run after
moving back to Java 6.
But my last attempt to install and run a Windows service on our staging
machine is now failing to run as a service as well, although I'm not
getting the commons-daemon error like before. Again I can run it fine
from startup.bat, and can install the service, but starting the service
fails. Nothing notable in stdout or stderr logs, either. Event viewer
says "The david2 Tomcat 7 service terminated with service-specific error
0 (0x0)." Bah.
What exactly is needed for the Tomcat bootstrapping to "find" the Java
install that it's to use? I thought that setting JAVA_HOME in
setenv.bat was a way, but apparently that's not used when it runs as a
service. Is it a matter of having JAVA_HOME set at the time that the
service is created, and it "keeps" that value in the service
configuration somehow? Or does the JAVA_HOME env var have to be set in
the environment of the service that's trying to run, every time it starts?
David
On 10/15/2011 10:31 AM, Pid wrote:
> On 14/10/2011 13:16, Konstantin Kolinko wrote:
>> 2011/10/14 David Rush<da...@rushtone.com>:
>>> I've been running Tomcat 6.0.18 for a long time, and am now trying to
>>> upgrade to 7.0.22 (64 bit .zip download).
>>>
>>> I can start Tomcat 7 with startup.bat and it's working fine.
>>>
>>> The script to install it as a service worked without complaint, and the
>>> service is there.
> Did you uninstall the old service first?
>
>
> p
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Tomcat 7 won't run as Windows service
Posted by Pid <pi...@pidster.com>.
On 14/10/2011 13:16, Konstantin Kolinko wrote:
> 2011/10/14 David Rush <da...@rushtone.com>:
>> I've been running Tomcat 6.0.18 for a long time, and am now trying to
>> upgrade to 7.0.22 (64 bit .zip download).
>>
>> I can start Tomcat 7 with startup.bat and it's working fine.
>>
>> The script to install it as a service worked without complaint, and the
>> service is there.
Did you uninstall the old service first?
p
Re: Tomcat 7 won't run as Windows service
Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/10/14 David Rush <da...@rushtone.com>:
> I've been running Tomcat 6.0.18 for a long time, and am now trying to
> upgrade to 7.0.22 (64 bit .zip download).
>
> I can start Tomcat 7 with startup.bat and it's working fine.
>
> The script to install it as a service worked without complaint, and the
> service is there.
>
> However when I try to start it I get "Error 1067: The process terminated
> unexpectedly".
>
> commons-daemon.2011-10-14.log says: [error] FindClass
> org/apache/catalina/startup/Bootstrap failed
>
> I'm using Java 7 JDK (1.7.0, 64 bit), JAVA_HOME points to the JDK
> installation, and Java's "bin" is in my system path, on my Windows 7
> machine.
There is not much experience in running with JDK 1.7.0 yet and
there are known problems
http://mail-archives.apache.org/mod_mbox/www-announce/201107.mbox/%3C001601cc4d6b$37618880$a6249980$@apache.org%3E
>
> I'm using the setenv.bat in tomcat\bin that I copied from my Tomcat 6
> installation, which explicitly sets JAVA_HOME (which technically may not be
> necessary since I have JAVA_HOME env var set to the same value, but I need
> to have the option to support more that one JVM on my development box).
> I've added a debug statement in setenv.bat that echoes something to a file.
> When I run startup.bat, I get the echoed output. When I try to start the
> service, I do not.
setenv.bat is not used when starting as a service.
The service runner is actually Apache Commons Daemon procrun component
http://commons.apache.org/daemon/
It launches JVM dll directly without any bat files.
If there are issues with this service launcher, it is better to report
them to the Commons Daemon project.
Best regards,
Konstantin Kolinko
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org