I cannot start TomCat

L

Leo

Dear All,

I am using Linux. I have installed J2EE SDK 1.4 at /opt/SUNWappserver.
And I have installed Tomcat at /opt/tomcat

In root mode, I added following lines to /root/.bashrc

export JAVA_HOME=/opt/SUNWappserver
export CATALINA_HOME=/opt/tomcat

export PATH=$PATH:/usr/local/genesis:$JAVA_HOME
export
CLASSPATH=$CATALINA_HOME/bin/bootstrap.jar:$JAVA_HOME/lib/tools.jar:$CATALINA_HOME/common/lib/servlet.jar:/usr/local/pgsql/share/java/postgresql.jar:../lib/struts.jar:.

When I try to fire up TomCat:
[root@cng1 tomcat]# ./bin/startup.sh
Using CATALINA_BASE: /opt/tomcat
Using CATALINA_HOME: /opt/tomcat
Using CATALINA_TMPDIR: /opt/tomcat/temp
Using JRE_HOME: /opt/SUNWappserver
[root@cng1 tomcat]#


Open a web browser in http://localhost:8080. No! TomCat is not running.

What are my problems? Thank you very much.
 
L

Leo

Andrea said:
Did you check the log file? I believe you will find your answer there

Thank you very much. The log file contains repeated following line:

/opt/tomcat/bin/catalina.sh: /opt/SUNWappserver/bin/java: No such file
or directory

In fact, this is Java part I am not clear: I have installed Java a
couple years ago. It is located in:

/usr/JAVA/j2sdk1.4.2/bin/javac

I just installed J2EE 1.4 SDK yesterday. Taking default locations, it is
located in:
/opt/SUNWappserver

[root@cng1 opt]# echo $JAVA_HOME
/opt/SUNWappserver

Shoule I set JAVA_HOME = /usr/JAVA/j2sdk1.4.2 ?

Is that bad practice to put javac and J2EE in different folders? How
should I clean up?

Many, many thanks!
 
L

Leo

Thank you all!

I got my TomCat running now! I think my fix is adding following line in
/root/bashrc file:

export $JAVA_HOME = /opt/SUNWappserver/jdk

(I don't know why, somebody's tutorial set $JAVA_HOME =
/opt/SUNWappserver/, which makes TomCat cannot find java)

I will think out running Tomant not as root, later. Thanks!
 
A

Andrea Desole

Leo said:
Dear All,

I am using Linux. I have installed J2EE SDK 1.4 at /opt/SUNWappserver.
And I have installed Tomcat at /opt/tomcat

In root mode, I added following lines to /root/.bashrc

export JAVA_HOME=/opt/SUNWappserver
export CATALINA_HOME=/opt/tomcat

export PATH=$PATH:/usr/local/genesis:$JAVA_HOME
export
CLASSPATH=$CATALINA_HOME/bin/bootstrap.jar:$JAVA_HOME/lib/tools.jar:$CATALINA_HOME/common/lib/servlet.jar:/usr/local/pgsql/share/java/postgresql.jar:../lib/struts.jar:.

it can be a bit confusing to specify the current and the parent
directory when you are defining the classpath in the bashrc. I'm not
sure the struts.jar will be found
What are my problems? Thank you very much.

Did you check the log file? I believe you will find your answer there
 
A

Andrea Desole

Leo said:
Is that bad practice to put javac and J2EE in different folders? How
should I clean up?

javac comes with the JDK, which is diffferent from the J2EE SDK. You can
also download a bundle J2EE/JDK, but I have personally never done it. I
prefer to use a separate JDK, to be a bit more flexible, for example
when I have to download an update. Actually, I usually don't even
download J2EE directly, I prefer to use the jars that come with the
server I use (usually JBoss).
Anyway, keep in mind that you might need JDK 5 to run Tomcat, depending
on the version you have, so your 1.4.2 might be not enough. If you have
a version of Tomcat that runs with 1.4 then setting JAVA_HOME to
/usr/JAVA/j2sdk1.4.2 is enough. Otherwise you will have to use a new
version of the JDK, either downloaded separately or the one that comes
with the J2EE SDK (I don't know how).
Many, many thanks!
you are welcome
 
J

Juha Laiho

Leo said:
Thank you very much. The log file contains repeated following line:

/opt/tomcat/bin/catalina.sh: /opt/SUNWappserver/bin/java: No such file
or directory

In fact, this is Java part I am not clear: I have installed Java a
couple years ago. It is located in:

/usr/JAVA/j2sdk1.4.2/bin/javac

.... and in that same bin directory you should have quite a pile of other
java-related executables, too; javac is just the java compiler, not
sufficient to run anything.
I just installed J2EE 1.4 SDK yesterday. Taking default locations, it is
located in:
/opt/SUNWappserver

Ok, do you really need this? Do you really need this now? If not, just
throw it away and take smaller steps. Tomcat doesn't need it.
Shoule I set JAVA_HOME = /usr/JAVA/j2sdk1.4.2 ?
Yes.

Is that bad practice to put javac and J2EE in different folders? How
should I clean up?

No, that's how they should be - if you need the J2EE in the first place.


Take small steps, read tutorials and documentation. And log files.

Btw, why do you run all that as root? It's an unnecessary security risk.
Both in the sense of outsider threats, but also working as root you
yourself have much better possibilities to have a simple mistake
turn into a disaster.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top