This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Trouble running tomcat on Ubuntu Linux.

 
Unnsse Khan
Ranch Hand
Posts: 511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello there,

Having trouble running tomcat on Ubuntu Linux 7.0.4.

I installed tomcat under:

/home/untz/DevTools/Java/tomcat/apache-tomcat-5.5.25

Created the CATALINA_HOME system environmental variable inside my .profile directory.

When I try to run TOMCAT, this is what I get:



This file (catalina.sh) is obviously located in the right directory...

When I try to run this file, this is what I get:



My CLASSPATH is set as:



What am I possibly doing wrong?

Happy programming,

Unnsse
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15272
37
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look inside the file /home/untz/DevTools/Java/tomcat/apache-tomcat-5.5.25/bin/catalina.sh and find out what it is doing with the BASEDIR variable.

Is CATALINA_HOME set correctly? What do you get if you type:

echo $CATALINA_HOME
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A quick way to rule out any typos in your environment variable is to use either the cd or ls command:



If neither of those work, you know you've got it wrong.

Also, unless you're trying to run more than one instance of Tomcat from the same codebase, there is no need to explicitly set the CATALINA_HOME environment variable. You only need to set JAVA_HOME or JRE_HOME.
startup.sh will set the CATALINA_HOME variable for you.
 
Unnsse Khan
Ranch Hand
Posts: 511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jesper & Ben,

Thanks for the responses!

There are not any typos...



Or:



Now, I thought it was a permissions things so inside the bin directory, I conducted a chmod + x *.sh:



When I try to run Tomcat, this is what I get:



Contents of startup.sh:



Contents of setclasspath.sh:



I am getting the BASEDIR problem in both OS X Tiger and Ubuntu 7.0.4...

When I googled, this problem, it seems as if a bunch of people were experiencing this but there was no solutions?!

See the search results (from Google) fficial&client=firefox-a" target="_blank" rel="nofollow">here.

This is really frustrating!

In the past five years, I've never experienced a problem that seems so simple to solve but something that just comes out of the box (when one downloads and unzips Tomcat from http://tomcat.apache.org)!?

With thanks,

Unnsse
 
Tualha Khan
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does the following command print on the console?

env

rgds,
tualha
 
Unnsse Khan
Ranch Hand
Posts: 511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I actually got it working...

What it was is that after you set the system environmental variable, you are supposed to start tomcat by manually issuing the entire path, instead of issuing it from $CATALINA_HOME.

So, for example, if $CATALINA_HOME is set to /usr/local/tomcat/

instead of trying to run it from the command line by issuing:

sh $CATALINA_HOME/bin/startup.sh

One should do it manually:

cd /usr/local/tomcat
/usr/local/tomcat $ sh startup.sh

And wa la! You'll see:

Using CATALINA_BASE: /usr/local/tomcat/
Using CATALINA_HOME: /usr/local/tomcat/
Using CATALINA_TMPDIR: /usr/local/tomcat/
Using JRE_HOME:
/System/Library/frameworks/JavaVM.framework/Versions/1.5.0/Home

After doing this once, $CATALINA_HOME works...

Got it working in both Linux and OS X...

Cheers,

Unnsse
[ October 12, 2007: Message edited by: Unnsse Khan ]
 
Noms Dom
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
do chmod +x catalina.sh
chmod +x startup.sh
and same for all .sh files in the tomcat bin dir it will work
 
Thilina Buddhika
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
chmod +x *.sh will do the trick.
 
See Furst
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unnsse Khan wrote:Hello there,

Having trouble running tomcat on Ubuntu Linux 7.0.4.

I installed tomcat under:

/home/untz/DevTools/Java/tomcat/apache-tomcat-5.5.25

Created the CATALINA_HOME system environmental variable inside my .profile directory.

When I try to run TOMCAT, this is what I get:



This file (catalina.sh) is obviously located in the right directory...

When I try to run this file, this is what I get:



My CLASSPATH is set as:



What am I possibly doing wrong?

Happy programming,

Unnsse


Hehe I get this:

something in the path is wonky.. but the server seems to start fine.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18152
52
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://www.coderanch.com/how-to/java/DontWakeTheZombies

You are going to confuse everyone. Whatever the original problem was in this thread, it was long enough ago that your problem is not likely to be the same thing.

We do not charge extra for starting your own message thread. In fact, we encourage it!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic