Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2006

Tip: Looking for answers? Try searching our database.

I cannot start TomCat

Thread view: 
Leo - 21 Mar 2006 10:57 GMT
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.
Andrea Desole - 21 Mar 2006 16:42 GMT
> Dear All,
>
[quoted text clipped - 9 lines]
> 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
Leo - 21 Mar 2006 11:58 GMT
> 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!
Leo - 21 Mar 2006 15:02 GMT
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!
Andrea Desole - 21 Mar 2006 17:43 GMT
> 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
Juha Laiho - 21 Mar 2006 19:39 GMT
Leo <xxx@nospam.com> said:

>> Did you check the log file? I believe you will find your answer there
>
[quoted text clipped - 7 lines]
>
>/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.
Signature

Wolf  a.k.a.  Juha Laiho     Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
        PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.