wood burning stoves 2.0*
The moose likes Tomcat and the fly likes Tomcat installation on Linux.. need help.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat installation on Linux.. need help.." Watch "Tomcat installation on Linux.. need help.." New topic
Author

Tomcat installation on Linux.. need help..

Merlin M Koppula
Ranch Hand

Joined: Jan 18, 2002
Posts: 69
Hello,
I had earlier version of Tomcat (3.x.x) on SuSe 7.2 with JDK 1.2.2. It was working well.
Recently, I installed Tomcat 4.0.1. The Rel notes said I can use JDK 1.2 or above. Since JDK 1.3 is very huge to download (~20 MB) and my modem speed is only 56K, I decided to stick with JDK 1.2.2.
All I did was get the tar.gz file from Tomcat site, unzip, set JAVA_HOME and CATALINA_HOME and run startup.sh
When I run startup.sh, it looked as if it ran OK (ie. gave the three line message: using <..> as JAVA_HOME, using <..> as CATALINA_HOME, etc.)
But when I tried to connect with:
http://localhost:8080, it gave an error (can not connect to the host...)
Then I looked into the log file $CATALINA_HOME/logs/catalina.log.
There seem to be some class not found errors for classes under org.apache.catalina.core.
My questions are:
1. Did I miss any set up step pointing CLASSPATH to some of the Tomcat libraries? I do not see any lib directory directly under CATALINA_HOME.
2. Is it a JDK version problem? The relese notes said JDK 1.2 and above should work.
Please someone tell me if I am doing something wrong?
Thanks.


MM Koppula<br />SCJP2<br />Object Oriented Analysis and Design with UML (IBM)
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
There should a lib directory. Are you sure that you extracted everything from the zip file?


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16022
    
  20

It's possible that the docs are out of date. I think that jdk 1.4 is now the latest Sun production version, anyway.
On the other hand, if the class not found exceptions were for classes whose names started with "org.apache", you probably don't have your classpath setup properly and you might want to read up on the appropriate Tomcat docs.
BTW, if you have any intentions of writing Swing apps, upgrade to JDK 1.3 or later een if you have to do it one chunk at a time over a week or more. 1.2 had more Swing bugs than a roach picnic.


Customer surveys are for companies who didn't pay proper attention to begin with.
Merlin M Koppula
Ranch Hand

Joined: Jan 18, 2002
Posts: 69
Thank you for your replies.
I now downloaded JDK 1.3.1_02 and Tomcat 4.02.
I set the paths accordingly for JAVA_HOME and CATALINA_HOME.
Set CLASSPATH to $JAVA_HOME/lib/tools.jar:$CATALINA_HOME/common/lib/servlet.jar
When I started Tomcat using startup.sh, I do not get any error messages. It gives the usual startup messages. Also, there are no messages loged in $CATALINA_HOME/logs/catalina.log.
Does it mean that Tomcat has started?
However, when I try to connect to http://localhost:8080 I get the error: cannot connect to host 8080.
1. How do I know if Tomcat has started. Which Linux processes does it kick off? What should I see in ps -ef?
2. I installed Tomcat and run startup.sh as my own userid. Do I need to startup as specific user?
Please help..
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16022
    
  20

This thread is cross-posted in the Linux forum :roll:
Merlin M Koppula
Ranch Hand

Joined: Jan 18, 2002
Posts: 69
If anyone had similar problems with Tomcat installation on SuSe linux, please post here.
I also get segment violation error when I try to shut down (does this happen if I try to shutdown when it is not actually running?)
I initially posted my question in Linux forum also hoping that some Linux developer might have encountered similar issue and solved it. But till now, no luck.
I greatly appriciate your help.
Merlin M Koppula
Ranch Hand

Joined: Jan 18, 2002
Posts: 69
I narrowed down the error in startup.sh and catalina.sh and found that I was getting a Segmentation fault error when the script is trying to run the actual java program
org.apache.catalina.startup.Bootstrap with one argument "start"
The actual line that is being executed is below:
/usr/lib/java/bin/java
-Djava.endorsed.dirs="/home/koppula/jakarta-tomcat-4.0.2/bin:/home/koppula/jakarta-tomcat-4.0.2/common/lib"
-classpath "/usr/lib/java/lib/tools.jar:/home/koppula/jakarta-tomcat-4.0.2/common/lib/servlet.jar:/home/koppula/jakarta-tomcat-4.0.2/bin/bootstrap.jar"
-Dcatalina.base="/home/koppula/jakarta-tomcat-4.0.2" \
-Dcatalina.home="/home/koppula/jakarta-tomcat-4.0.2" \
-Djava.io.tmpdir="/home/koppula/jakarta-tomcat-4.0.2/temp" \
org.apache.catalina.startup.Bootstrap start
I was able to run other java programs with the JDK that I installed (at /usr/lib/java). So, I think it is not a problem with the Java installation.
Is the script passing the right arguments to the Java program? The only argument that is being passed in the script is "start"?
Any help is appriciated..
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16022
    
  20

Try doing a "ulimit -s 1024" before starting the server.
That usually cures segfaults.
Merlin M Koppula
Ranch Hand

Joined: Jan 18, 2002
Posts: 69
I downloaded jsdk1.4.0 and it is working now. For some reason, Tomcat 4.0 gives a segment fault error with jdk1.3.02.
Tim, I checked the value of ulimit before. It was already unlimited. I also tried with 2048. So, I didn't think that was the problem.
Thank you every one
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Tomcat installation on Linux.. need help..