Two Laptop Bag*
The moose likes Tomcat and the fly likes Problem starting TOMCAT version 5 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Tomcat
Bookmark "Problem starting TOMCAT version 5" Watch "Problem starting TOMCAT version 5" New topic
Author

Problem starting TOMCAT version 5

Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 576
I am having problems starting up TOMCAT version 5, The instructions are a bit confusing in setting the environment variables.
I have set my class path to

C:\%JAVA_HOME%;%CATALINA_HOME%;C:\oracle\ora90\jdbc\lib\classes12.zip;
CATALINA_HOME is set to C:\jakarta-tomcat-5.0.19\bin
JAVA_HOME is set to j2sdk1.4.2_03\bin
PATH is set to C:\j2sdk1.4.2_03\bin;C:\jakarta-tomcat-5.0.19\bin;C:\oracle\ora90\jdbc\lib\classes12.zip;C:\oracle\ora90\bin;C:\oracle\ora90\Apache\Perl\5.00503\bin\mswin32-x86;C:\Program Files\Oracle\jre\1.1.8\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem.
But I get the following Error
The CATALINA_HOME environment variable is not defined correctly
The environment variable is needed to run this program.
Do I need to set another environment variable.
Thanks for any help.
Tony
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

CATALINA_HOME is set to C:\jakarta-tomcat-5.0.19\bin

Should be 'C:\jakarta-tomcat-5.0.19'
PS. you don't need to set CATALINA_HOME - just delete it.
Ren�
[ February 29, 2004: Message edited by: Rene Larsen ]

Regards, Rene Larsen
Dropbox Invite
Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 576
Thanks Rene, its got rid of the error message but what happens now is the command prompt just pop up and disappears when I run the startup.bat.
I have tried changing
call "%EXECUTABLE%" start %CMD_LINE_ARGS%
to
call "%EXECUTABLE%" run %CMD_LINE_ARGS%
but window still disapperas makes it hard to debug.
Is there anyway of keeping the window open.
Thanks for any help.
Tony
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

To keep the window open (using Windows NT/2000/XP) you need to change this line:

to this:

Ren�
[ February 29, 2004: Message edited by: Rene Larsen ]
Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 576
Thanks again Rene
I set set _EXECJAVA=start "Tomcat" %_RUNJAVA%
to
set _EXECJAVA=start %_RUNJAVA%
within the file catalina.bat, I could not fimd that line of code in the startup.bat but it calls catalina.bat so I guess that is where you meant this line to be changed.
LOL still cant stop the command prompt from disappearing.
Is there a command I can run in the command prompt itself that will keep the window open, as i have a feeling thatw aht works for TomCat 4 will not work for Tomcat-5.
Thanks again
Tony
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

No 'start' in the line!! - set _EXECJAVA=%_RUNJAVA%
I can see that your JAVA_HOME is wrong too.
it should be set to: 'C:/j2sdk1.4.2_03'
Ren�
[ February 29, 2004: Message edited by: Rene Larsen ]
Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 576
Hi Rene,
Thanks for taking time out to help me. I ahve done whay you said I have set JAVA_HOME to j2sdk1.4.2_03
and in catalina I have commented out
set _EXECJAVA=start "Tomcat" %_RUNJAVA%
set _EXECJAVA=start %_RUNJAVA%
but still get the same problem. Is there a prompt line of code taht will stop the program running. I could use that as a binary chop debug to narrow down where I am going wrong. A line of code that will stop the program but keep the window up si I can see what is being written out. Thanks again.
Tony
oStart
shift
if not "%OS%" == "Windows_NT" goto noTitle
rem set _EXECJAVA=start "Tomcat" %_RUNJAVA%
set _EXECJAVA=%_RUNJAVA%
goto gotTitle
:noTitle
rem set _EXECJAVA=start %_RUNJAVA%
set _EXECJAVA=%_RUNJAVA%
:gotTitle
if not ""%1"" == ""-security"" goto execCmd
shift
echo Using Security Manager
set SECURITY_POLICY_FILE=%CATALINA_BASE%\conf\catalina.policy
goto execCmd
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

In your first post you wrote: 'JAVA_HOME is set to j2sdk1.4.2_03\bin' and it should be set to the drive where the folder is and without the bin folder - 'JAVA_HOME=C:\j2sdk1.4.2_03'
Try to execute/call 'startup.bat' from a command promt.
When you just double click on it it will close and you won't see the errors and what really is going on.
Ren�
Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 576
I have solved the problem of the closing dos window, I commented out exit.
I have the correct error message
Cant find j2sdk1.4.2_03\bin\java.exe from the setclasspath file.
In C:\j2sdk1.4.2_03\bin I do have the java application within this directory.
Is there been any problems reported with j2sdk1.4.2_03
Thanks for any help Tony
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12792
    
    5
Exactly where have you set JAVA_HOME? For the entire system or just one command window? If you open a new command prompt and type set - do you see the correct JAVA_HOME listed?
Also note that Tomcat from 4(or maybe even 3) on does not pay any attention to the Environment classpath.
Incidently, I just started Tomcat 5.0.19 using the line
call "%EXECUTABLE%" run %CMD_LINE_ARGS%
in startup.bat, - Catalina.bat executed in the same window.
Bill
[ February 29, 2004: Message edited by: William Brogden ]
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

You need to include C:\ in JAVA_HOME....
Ren�
[ February 29, 2004: Message edited by: Rene Larsen ]
Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 576
Thanks everyone, got the script running
with so many bits to set, classpath, path, and JAVA_HOME and CATALINA_HOME, still not sure what I got right, so my advice to anyone else with the same problem is comment out exit at the bottom of setclasspath this will keep the dos window open.
use rem exit
and the use echo %JAVA_HOME% to see where its pointing to at the start of the setclasspath file.
Thanks again everyone.
LOL Onto my next lot of errors now but will try and sort them out before asking for help
Tony
 
GeeCON Prague 2014
 
subject: Problem starting TOMCAT version 5