• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem starting Tomcat 4.1.31 on Mac OS X

 
Richard Everhart
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65125
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
Richard Everhart
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for putting your solution here John,

I love JavaRanch.
 
kwame Iwegbue
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65125
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
kwame Iwegbue
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65125
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65125
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65125
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not really. I've never has an iota of problems.

Does a freshly installed Tomcat instance run OK?
 
kwame Iwegbue
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
WORKS!
I downloaded version 5.5.23 and it works now without any modification. Thanks Bear.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic