File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes start/stop Tomcat 7 windows service on 64-bit results in error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "start/stop Tomcat 7 windows service on 64-bit results in error" Watch "start/stop Tomcat 7 windows service on 64-bit results in error" New topic
Author

start/stop Tomcat 7 windows service on 64-bit results in error

Glen Merrill
Greenhorn

Joined: Nov 05, 2010
Posts: 3
I have installed Apache Tomcat 7.0.4 on both Windows 7 (64-bit) and Windows Vista (64-bit) along with Java 6 r22.

I used the .exe installer for Tomcat to get the windows service for tomcat. When I start the service it fails with the following error:

Windows could not start the Apache Tomcat 7 on Local Computer. For more information, review the System Event Log. If this is a non-Microsoft service, contact the service vendor, and refer to the service-specific error code 0.

If i try to start it again, it starts successfully.

When I try to stop the service, I get the following error:

Windows could not stop the Apache Tomcat 7 service on Local Computer.

Error 109: The pipe has been ended.


Everytime after this it takes 2 tries to start the server and fails with the same error on stop. Other than these errors the server itself is working fine.


Tom Reilly
Rancher

Joined: Jun 01, 2010
Posts: 618
Does the System Event Log give you any more information? Have you tried running it as a non-service?
Glen Merrill
Greenhorn

Joined: Nov 05, 2010
Posts: 3
Running it from the command line acts similarly. When i try to start the server, the first time it does nothing (shows nothing in the command prompt) and starts successfully the second time.

And the event log seems to have the same information as the error popup.
Also, this is a clean install of tomcat with no webapps installed and no other instances of tomcat or java installed. We have now tried this on Windows 7, Vista and Windows Server 2003 (all 64-bit). The 64 bit versions of Tomcat 6 we previously used on these machines had no issues on startup/shutdown.

I did notice one thing. If i delete the tomcat7.pid file from the log directory after shutting down tomcat, i can restart it without doing it twice (This is whats happens when i start the service twice, the first time it deletes the pid file and fails and then it starts correctly the second time).
Brent Miller
Greenhorn

Joined: Nov 18, 2010
Posts: 2
I am having the exact same problem with Tomcat 7 on a 32-bit Windows 7 machine. For some reason the tomcat7.pid file is not getting deleted when shutting down the server.
Glen Merrill
Greenhorn

Joined: Nov 05, 2010
Posts: 3
After some experimenting, i did get it work by doing the following, i dont know if there are any unintended consequences, but it not starts/stops correctly.

1. Run the tomcat7w.exe config util in tomcat/bin
2) Goto the shutdown tab and change the mode drop down from JVM to Java. I left the startup tab mode as JVM.
Brent Miller
Greenhorn

Joined: Nov 18, 2010
Posts: 2
Works for me, thanks!
camelo
Greenhorn

Joined: May 28, 2002
Posts: 3
Working for me. Thanks!!!
Chaim Krause
Greenhorn

Joined: Jan 04, 2011
Posts: 2
I am experiencing this too.

Is there documentation on what the differences are between Java, jvm, and exe? I can't find any and I am curious what the differences are.
Frank Aiche
Greenhorn

Joined: Jan 28, 2011
Posts: 1
Hello,

I'm having the same problem. Once I stop the server, and the error appears, I am not able to edit files in my project. Something seems to be hanging on to the file, so maybe it's not entirely shutting down. If I change the shutdown Mode to "Java" as described above, I am am not able to start the tomcat service.

I have tried Tomcat 6 and Tomcat 7, and am getting the same results. The box tomcat is running on is Windows 2008 R2.

Any help?

Thanks!
Frank

EDIT/UPDATE: I downgraded from 6.0.30 to 6.0.29, and the error goes away. Also, it turns out that the error is benign. the server was actually stopping even though the error occurs. Nothing was hanging on to a file inside the webapps. Permissions was actually keeping me from editing the file.
TomTom Lee
Greenhorn

Joined: Jun 15, 2007
Posts: 8
What fixed this for me is I removed a System.exit call in the destroy method of my servlet. I think tomcat wants to handle ending the application. It doesn't like when you end the application yourself.
Yann Petit
Greenhorn

Joined: Jul 05, 2011
Posts: 1
AFAIK there are two different problems here.

As already said by Glenn, replacing the Startup and Shutdown mode by JAva instead of JVM should do the trick for those running tomcat 7.06 +
This can be done by running %TOMCAT_HOME%\bin\tomcat7w.exe and go to the "Startup" and "Shutdown" tabs, then change the "Mode" field from "Jvm" to "Java".

But for those running tomcat 7.04 - you also need to disable the use of the Tomcat.pid file.
This can be done by running %TOMCAT_HOME%\bin\tomcat7w.exe and go to the "Logging" tab, then empty the "PID file" field.

In fact the windows installer automatically configure the use of such a file, but running tomcat as a service fails to delete the file which prevents the service to start again. But it seems that starting the service deletes the file and launching it a second time will succeed.

Hope this helps...
Buminda Nawagamuwa
Greenhorn

Joined: Nov 28, 2011
Posts: 1
I made both tabs to Java, then I managed to start the service.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: start/stop Tomcat 7 windows service on 64-bit results in error
 
Similar Threads
Tomcat 5 and Tomcat 4 Install
Problems stopping tomcat 6.0.32 on windows
Unable to see Tomcat 5.5 welcome page,manager,host manager
how to start and stop tomcat 5.5 server
tomcat is not starting in the windows 2008 R2 environment