aspose file tools*
The moose likes Mac OS and the fly likes Problem starting Tomcat 4.1.31 on Mac OS X Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Mac OS
Bookmark "Problem starting Tomcat 4.1.31 on Mac OS X" Watch "Problem starting Tomcat 4.1.31 on Mac OS X" New topic
Author

Problem starting Tomcat 4.1.31 on Mac OS X

Richard Everhart
Ranch Hand

Joined: Nov 19, 2003
Posts: 54
I've used Tomcat before on Linux, Solaris and Windows and never come across this problem (or, at least I don't recall seeing it before). When I try to invoke startup.sh I get the following error:



I've defined CATALINE_HOME in my .bashrc to point to my Tomcat installation directory, and just to be sure, I've defined BASEDIR to point to the same directory. What else could I be missing?

Thanks.

Rich
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61010
    
  65

I did a grep for BASEDIR in the bin folder and came up with:

[bear@booboo bin]$ grep BASEDIR *
catalina.sh: BASEDIR="$CATALINA_HOME"
setclasspath.sh:if [ -z "$BASEDIR" ]; then
setclasspath.sh: echo "The BASEDIR environment variable is not defined"
setclasspath.sh:if [ ! -r "$BASEDIR"/bin/setclasspath.sh ]; then
setclasspath.sh: echo "The BASEDIR environment variable is not defined correctly"
setclasspath.sh:JAVA_ENDORSED_DIRS="$BASEDIR"/common/endorsed
tool-wrapper.sh: BASEDIR="$CATALINA_HOME"
tool-wrapper.sh:CLASSPATH="$CLASSPATH":"$CATALINA_HOME"/bin/bootstrap.jar:"$BASEDIR"/common/lib/jmx.jar

This is for a Tomcat 5.0.25 installation. I made no changes to the files.

bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by Richard Everhart:

I've defined CATALINE_HOME in my .bashrc to point to my Tomcat installation directory, and just to be sure, I've defined BASEDIR to point to the same directory. What else could I be missing?


You don't need to set BASEDIR, it's internal to the wrapper scripts.

You generally don't need to set CATALINA_HOME either but if you've set it you might want to test it to make sure it's right:

Or, Better:


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Richard Everhart
Ranch Hand

Joined: Nov 19, 2003
Posts: 54
Thanks for all the help. 4.1.31 just didn't work, even after following everyone's suggestions. So, I downloaded 5.0.28 and it starts just fine. Still not sure what the problem was.

Thanks again.

Rich
John Sievel
Greenhorn

Joined: Mar 29, 2005
Posts: 1
Rich,

I had the same problem you did, but it did not go away with 5. Finally I noticed that the other .sh files lacked execute. Once I put it on them, it started fine. Before that, it just complained about the BASEDIR.
Darryl Nortje
Ranch Hand

Joined: Jun 11, 2002
Posts: 140
Thanks for putting your solution here John,

I love JavaRanch.
kwame Iwegbue
Ranch Hand

Joined: Sep 02, 2000
Posts: 197
Sorry to re-open this old thread, but I'm having this exact problem now. When I try to run startup.sh I get this error:
The BASEDIR environment variable is not defined correctly

someone said they put execute in the .sh files. please how do you do that?


Who dares, wins! (SAS motto)
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61010
    
  65

When I start Tomcat, I see:

Using CATALINA_BASE: /Library/apache-tomcat-5.5.20
Using CATALINA_HOME: /Library/apache-tomcat-5.5.20
Using CATALINA_TMPDIR: /Library/apache-tomcat-5.5.20/temp
Using JRE_HOME: /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home

Check your setting for CATALINA_HOME, BASEDIR is set to this value in catalina.sh.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41532
    
  53
someone said they put execute in the .sh files. please how do you do that?


Un a Unix/Linux/OS X system it would be something like

chmod ugo+x $TOMCAT_HOME/bin/*.sh


Ping & DNS - my free Android networking tools app
kwame Iwegbue
Ranch Hand

Joined: Sep 02, 2000
Posts: 197
I'm not getting any info bash when i type

$CATALINA_HOME (i had already set alias CATALINA_HOME="/path/to/tomcat-root" in my .proflie)

also not getting any info with $JRE_HOME or even $JDK_HOME
kwame Iwegbue
Ranch Hand

Joined: Sep 02, 2000
Posts: 197
I've fixed the environment variable problem. $CATALINA_HOME is now set but when I run ./startup.sh I still get this error:
The BASEDIR environment variable is not defined correctly

I even set BASEDIR=$CATALINA_HOME

the error seems to be coming from setclasspath.sh


[ March 09, 2007: Message edited by: kwame Iwegbue ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61010
    
  65

Have you mucked around with the script files in /bin?

If you have, restore them to their original state.

The only environment variable that needs to be set is JAVA_HOME. The script files will take care of the rest.
kwame Iwegbue
Ranch Hand

Joined: Sep 02, 2000
Posts: 197
I haven't modified any of the script files. I set
$JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home

still getting same error. only thing I can think of is maybe the envirnment variables scope. so far i've been setting them in my .profile so it works when i type echo $JAVA_HOME, but its not listed when i type env. Can you please tell me how to make the variables global? maybe that would work
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61010
    
  65

If you are using the bash shell. place the following in your .bash_profile

export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home
kwame Iwegbue
Ranch Hand

Joined: Sep 02, 2000
Posts: 197
Still getting same error: The BASEDIR environment variable is not defined correctly

my JAVA_HOME has been set correctly and shows up in env.

Any ideas?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61010
    
  65

Not really. I've never has an iota of problems.

Does a freshly installed Tomcat instance run OK?
kwame Iwegbue
Ranch Hand

Joined: Sep 02, 2000
Posts: 197
This is a freshly installed Tomcat instance. I just can't figure out why it wants me to set BASEDIR env variable. Maybe I'll reinstall the whole thing and see what happens.

Anyway. for now i'll just keep using tomcat on windows. Luckily I have Parallels!
kwame Iwegbue
Ranch Hand

Joined: Sep 02, 2000
Posts: 197
WORKS!
I downloaded version 5.5.23 and it works now without any modification. Thanks Bear.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Problem starting Tomcat 4.1.31 on Mac OS X