aspose file tools*
The moose likes Tomcat and the fly likes Command window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Command window" Watch "Command window" New topic
Author

Command window

Velika Srbija
Ranch Hand

Joined: Jan 15, 2002
Posts: 172
What way I could hide Command prompt window (under win2000) when I start Tomcat?
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

Start it as a Service.

There is an option to install Tomcat as a service on Win NT/2000 when you first install Tomcat. If it's too late for you to run the installer again, then you could probably use a few registry tricks to produce the same result.
Velika Srbija
Ranch Hand

Joined: Jan 15, 2002
Posts: 172
It's OK!
But I don't know how to install Tomcat as a service. There is no installation procedure for the Tomcat (under win2000).
When installing Tomcat, the only thing I have to do is to unzip jakarta-tomcat-4.0.1.zip archive, set env, Context ... and it works OK.
Still can't find how to run as a service.
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

Try this post: http://www.coderanch.com/t/81928/Tomcat/Tomcat-as-service
Rene


Regards, Rene Larsen
Dropbox Invite
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

Rene's trick is the way to go, but for the record, I meant the Windows *.exe installer.
Velika Srbija
Ranch Hand

Joined: Jan 15, 2002
Posts: 172
Thanks!
I'll try it.
Matthew Webster
Ranch Hand

Joined: May 10, 2001
Posts: 51
Also, I get all my applications written in Java to start without a Dos window by placing
start "my apps name" javaw.exe somejar.jar -classpath durdurdurdur
in their .bat file.
This 'start "..."' function should work with the Tomcat startup too.
good luck,
matt.


Matthew Webster - eudoxus@freeuk.com<br /><a href="http://www.matthewwebster.homeunix.net/" target="_blank" rel="nofollow">http://www.matthewwebster.homeunix.net/</a>
Velika Srbija
Ranch Hand

Joined: Jan 15, 2002
Posts: 172
Yes, I know how to use javaw but never tried to insert it into Tomcat's startup.bat.
Thanks again to you all.
I'll inform you what fits my needs best.
Velika Srbija
Ranch Hand

Joined: Jan 15, 2002
Posts: 172
>> for
>> Rene Larsen
I've tried your procedure.
It doesn't work for me.
I'm getting some errors.
Here they are:
On windows NT:
--------------
Could not start Apache Tomcat service on Local Computer.
Error 2140: An internal Windows NT error occurred.
On windows 2000 Professional:
-----------------------------
Could not start the Apache Tomcat service on Local Computer.
The service did not return an error. This could be an internal Windows error or an internal service error.
******* What is goin' on?
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

Did you set '%CATALINA_HOME%' and '%JAVA_HOME%' as a system enviroment variable?
'%JAVA_HOME%' should point to a SDK and not to a JRE version.
Rene
Velika Srbija
Ranch Hand

Joined: Jan 15, 2002
Posts: 172
Yes, I did it.
I have already told you. Everything is working properly when I start Tomcat as a standalone application (through startup.bat). My JavaWebApp works OK.
----------------------------------
I made a new .bat file out of the code you presented at the following link:
http://www.coderanch.com/t/81928/Tomcat/Tomcat-as-service
When I start the same .bat file, service installs without errors, but when I try to start it an error occurs. Allready told you what kind of error.
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

Did you remember all spaces in the call to 'tomcat'?
You will not get an error when you install the service, put you will when you try to start the service if there is some type errors in the call.
There should be spaces between each line from my code - but the call to 'tomcat' should be made as one line.
Rene
Velika Srbija
Ranch Hand

Joined: Jan 15, 2002
Posts: 172
"There should be spaces between each line from my code - but the call to 'tomcat' should be made as one line."
What kind of spaces?
Every line of your code is in it's own line, except call to 'tomcat'. It's OK. I made call to 'tomcat' in a single line.
But, do you mean I should put an empty row between each other row of your code.
After what you have had told me I understand that cr\lf is not sufficient.?
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

No what I mean is that when you rearrange the call to tomcat there should be a space between.
e.g. like this:


Rene
Velika Srbija
Ranch Hand

Joined: Jan 15, 2002
Posts: 172
I understood that earlier.
Check ths:
-out "%CATALINA_HOME%\logs\catalina.out"
-err "%CATALINA_HOME%\logs\stderr.log"
doesn't point anywhere.
Files 'catalina.out' and 'stderr.log' doesn't exist when I unpack Tomcat4 .zip archive. Do I have to make them explicitly?
Velika Srbija
Ranch Hand

Joined: Jan 15, 2002
Posts: 172
Sorry.
It's OK now.
Your script works great.
I had uninstalled the service on win2K, and then installed again... Then it worked well. Not sure what caused the problem first time.

On NT4, the problem was related to the path.
When changed path to C:\catal... (not to C:\Program Files\catal...) everything worked well when ran as a service.
There is no problem to start Tomcat as a standallone app from any path, including C:\Program Files\catal...

Thank you Rene very much.
Have a nice surfing.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Command window