aspose file tools*
The moose likes Servlets and the fly likes tomcat not running?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "tomcat not running??" Watch "tomcat not running??" New topic
Author

tomcat not running??

preeti dengri
Ranch Hand

Joined: Nov 30, 2000
Posts: 111
Hi,
i have tomcat and jdk1.3 installed under c:\ with WIN ME as the OS and configured the autoexec.bat file as follows
SET PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;"C:\Program Files\Mts";c:\jdk1.3\bin;C:\PROGRA~1\MICROS~6\80\TOOLS\BINN;C:\MSSQL7\BINN
SET CLASSPATH=.;c:\jdk1.3\lib;c:\javaexamples;c:\jdk1.3\lib\tools.jar;c:\tomcat\classes;c:\tomcat\lib\ANT.JAR;c:\tomcat\lib\XML.JAR;c:\tomcat\lib\WEBSERVER.JAR;c:\tomcat\lib\SERVLET.JA R;c:\tomcat\lib\JASPER.JAR
SET JAVA_HOME=c:\jdk1.3
SET TOMCAT_HOME=c:\tomcat
and when i try to run tomcat at
c:\tomcat\bin>tomcat start
or
c:\tomcat\bin>startup
gives
"bad command or filename"
i have tried solving this by reading other posts but no way.
please help
preeti
Andrew Shafer
Ranch Hand

Joined: Jan 19, 2001
Posts: 338

C:\tomcat\bin is not in your path.
Neither is the current directory.
Fully specify the path or got the bin directory and type: .\startup
Whenever you see that message it means the command is mistyped or not in the path.


!_I_Know_Kung_Fu_!
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

I would first do a dir in the C:\tomcat\bin
directory to verify that the much needed batch files
are avail. You should see, among other things,
tomcat.bat, startup.bat, shutdown.bat
Also, observer that they are not all of 0 kB size.
let us know what you find.
While it is not new that people sometime download the
wrong zip file. It has happened in the past.
regds.
- satya

Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
preeti dengri
Ranch Hand

Joined: Nov 30, 2000
Posts: 111
Hi,
i added the current dir as well as tomcat/bin in the path and the autoexec.bat is now
SET PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;"C:\Program Files\Mts";c:\jdk1.3\bin;C:\PROGRA~1\MICROS~6\80\TOOLS\BINN;C:\MSSQL7\BINN;.;c:\tomcat\bin
SET CLASSPATH=.;c:\jdk1.3\lib;c:\javaexamples;c:\jdk1.3\lib\tools.jar;c:\tomcat\classes;c:\tomcat\lib\ANT.JAR;c:\tomcat\lib\XML.JAR;c:\tomcat\lib\WEBSERVER.JAR;c:\tomcat\lib\SERVLET.JA R;c:\tomcat\lib\JASPER.JAR
SET JAVA_HOME=c:\jdk1.3
SET TOMCAT_HOME=c:\tomcat

but the error comes to be
Set TOMCAT_HOME=
echo unable to determine the value of TOMCAT_HOME
gotoeof
:gothome
rem set up the CLASSPATH that we need
set cp=.;c:\jdk1.3\lib;c:\javaexamples;c:\jdk1.3\lib\tools.jar;c:\tomcat\classes;c:\tomcat\lib\ANT.JAR;c:\tomcat\lib\XML.JAR;c:\tomcat\lib\WEBSERVER.JAR;c:\tomcat\lib\SERVLET.JAR;c:\to mcat\lib\JASPER.JAR //--------------this is the same as already set
set CLASSPATH=.
set CLASSPATH=c:\tomcat\classes
set CLASSPATH=.;c:\jdk1.3\lib;c:\javaexamples;c:\jdk1.3\lib\tools.jar;c:\tomcat\classes;c:\tomcat\lib\ANT.JAR;c:\tomcat\lib\XML.JAR;c:\tomcat\lib\WEBSERVER.JAR;c:\tomcat\lib\SERVLET.JA R;c:\tomcat\lib\JASPER.JAR //-------this is also as set
set CLASSPATH=.;c:\jdk1.3\lib;c:
bad command or file name
could not interpret the errors
please help
preeti
Andrew Shafer
Ranch Hand

Joined: Jan 19, 2001
Posts: 338

Hmmm,
When are you getting that error?
When you try to run startup?
Can you check the value of Tomcat_home from a Dos prompt?
I'm not sure what is wrong now, I've never tried to run tomcat on a M$ OS. Only on Linux
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
preethi:
in a dos window, type set TOMCAT_HOME
and let us know what it returns....
- satya
preeti dengri
Ranch Hand

Joined: Nov 30, 2000
Posts: 111
none of the files are of 0 kb and all the three .bat files(tomcat , startup and shutdown except others)are present under /tomcat/bin
preeti dengri
Ranch Hand

Joined: Nov 30, 2000
Posts: 111
the error is coming while i type tomcat start or startup on the command prompt
c:\tomcat\bin>tomcat start
or
c:\tomcat\bin\>startup
and c:\set TOMCAT_HOME
gives
syntax error
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

you are using ME.........
try typing set
and see if it spits out TOMCAT_HOME variable....
- satya
preeti dengri
Ranch Hand

Joined: Nov 30, 2000
Posts: 111
yes it gives
TOMCAT_HOME=c:\tomcat
(which i have set that way)
when i type "set" in command prompt
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
what was the value of JAVA_HOME ?
- satya
preeti dengri
Ranch Hand

Joined: Nov 30, 2000
Posts: 111
the value for JAVA_HOME is c:\jdk1.3
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

could you tell us which tomcat you downloaded. maybe you
have the wrong exe......just guessing.
also, if you have jdk1.2 installed on your system already
then I would suggest you to change the JAVA_HOME to point
to that folder and try....
i think the current release is tomcat-3.2.1 and the zip file
is abt 3.0MB, if I remember correct...yup, this is the link i am
talking abt:
http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.2.1/bin/
let us know how you are doing......

- satya
preeti dengri
Ranch Hand

Joined: Nov 30, 2000
Posts: 111
i have tomcat version 3.1.1 around 2.2 MB zip file.i will now download the 3.2.1 version u gave me the link for and try it.Hope that works right for me.
Thank You Madhav for taking time to guide me but i may be back if i found anything with that ver too.
regards
preeti
preeti dengri
Ranch Hand

Joined: Nov 30, 2000
Posts: 111
Hi,
i downloaded the ver 3.2.1 following the link provided and took the right steps.on typing
c:\tomcat\bin>tomcat start i m getting
starting tomcat in a new window
using classpath: c:\tomcat\classes;c:\tomcat\lib\webserver.jar;c:\tomcat\lib\xml.jar;c:\tomcat\lib\jasper.jar;c:\tomcat\lib\servlet.jar;c:\jdk1.3\lib\tools.jar;c:\.;c:\jdk1.3\lib;c:\jdk1.3\javaexam ples
c:\tomcat\bin>

is this the correct way of starting tomcat or still there is some error ???
i am unable to get to the tomcat first screen by typing http://localhost:8080 in the browser window after starting tomcat as above
please help
Phil Hanna
Ranch Hand

Joined: Apr 05, 2001
Posts: 118
Setting the classpath in autoexec.bat is a bad idea. It is better to have no CLASSPATH environment variable defined at all, and to use the -classpath option on a java invocation.
Try this: commend out your "SET CLASSPATH" statement in autoexec.bat and reboot. Then go to tomcat/bin and enter "tomcat run" (instead of "startup") so that you can see any error messages that float by.
------------------
Phil Hanna
Sun Certified Programmer for the Java 2 Platform
Author of :
JSP: The Complete Reference
Instant Java Servlets


Phil Hanna<BR>Sun Certified Programmer for the Java 2 Platform<BR>Author of :<BR><A HREF="http://www.amazon.com/exec/obidos/ASIN/0072127686/electricporkchop/107-3548162-1137317" TARGET=_blank rel="nofollow">JSP: The Complete Reference</A><BR><A HREF="http://www.amazon.com/exec/obidos/ASIN/0072124253/electricporkchop/107-3548162-1137317" TARGET=_blank rel="nofollow">Instant Java Servlets</A>
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

also, in the new window are you able to see something like this:

this tells you that the server has started on port 8080
Additionally observe what Phil has to say abt classpath.
regds.
- satya
preeti dengri
Ranch Hand

Joined: Nov 30, 2000
Posts: 111
Hi,
acc to Phil, i did comment out the Set Classpath and reboot
then tried tomcat run at c:\tomcat\bin
and got
Using Classpath:c:\tomcat\classes;c:\tomcat\lib\webserver.jar;c:\tomcat\lib\jasper.jar;c:\tomcat\lib\xml.jar;c:\tomcat\lib\servlet.jar;c:\jdk1.3\lib\tools.jar
Exception in thread "main" java.lang.NoClassDefFoundError: org/xml/sax/HandlerBase
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:477)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:10
)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
at java.net.URLClassLoader.access$1(URLClassLoader.java:216)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:191)
at java.lang.ClassLoader.loadClass(ClassLoader.java:298)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:285)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:314)
at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:168)
at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:235)
if i try tomcat start or startup at command prompt
it still gives
starting tomcat in new window
using classpath :----------- as mentioned in previous post
a new window appear momentarily
and back to previous window with cursor at
c:\tomcat\bin>
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
Using Classpath:
c:\tomcat\classes;
c:\tomcat\lib\webserver.jar;
c:\tomcat\lib\jasper.jar;
c:\tomcat\lib\xml.jar;
c:\tomcat\lib\servlet.jar;
c:\jdk1.3\lib\tools.jar

The fact that you get a popup window and it closes immediately
means that an Exception is beign thrown and so the app terminates.
I would be tempted to verify the existance of all the above
files on the OS, ie; physical existance using Windows Explorer
or using the dir command. In particular c:\jdk1.3\lib\tools.jar, since I am not familiar with
JDK1.3
regds.
- satya

preeti dengri
Ranch Hand

Joined: Nov 30, 2000
Posts: 111
the following are missing from the tomcat
dir classes
and
xml.jar
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
Exception in thread "main" java.lang.NoClassDefFoundError: org/xml/sax/HandlerBase
thats what I thought. see the exception for the xml stuff you got.....
Looks like you need to extract that file from the
zip file you obtained. Open the zip file in WinZip
and see if that file is avail in your downloaded zip
file or not.....
regds.
- satya
preeti dengri
Ranch Hand

Joined: Nov 30, 2000
Posts: 111
oh yes i don't have the xml.jar file in the zip file .why so?
the download was all done right.do i need to download again?
if that was the reason ,i am really sorry to bother u this much .
regards
preeti
Phil Hanna
Ranch Hand

Joined: Apr 05, 2001
Posts: 118
So you are missing xml.jar - do you have it somewhere in your Tomcat distribution? If so, put it in the lib directory as indicated.
When you start Tomcat, use

instead of

or

that way, you can keep the window open and see the stack trace.
Resist the temptation to set CLASSPATH in autoexec.bat.
------------------
Phil Hanna
Sun Certified Programmer for the Java 2 Platform
Author of :
JSP: The Complete Reference
Instant Java Servlets
Website: http://www.philhanna.com
preeti dengri
Ranch Hand

Joined: Nov 30, 2000
Posts: 111
Hi ,
i didn't find xml.jar in the tomcat distribution. and downloaded it again but no xml jar file there as well(Don't know what's happening) .I am downloading the jakarta-tomcat-3.2.1.zip from the link http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.2.1/bin/
I will try it again.
Thanks for the help Phil and Madhav
regards
preeti
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

Could you do a search on your C: drive for xml.jar
from the Start button (if you have one, not sure how
ME looks like) then "Find -> File" or from Windows
Explorer...
Trust me the Tomcat download link is correct.
Not sure what your system is doing, Sorry couldn't help more...
You must already be hating me for having changed your mind
from JWSDK to Tomcat....
Also, I am not familiar with "tomcat run" configuration....
- satya
preeti dengri
Ranch Hand

Joined: Nov 30, 2000
Posts: 111
Hi madhav and Phil,
Thank you both for ur support especially Madhav (who must be real tired answering my queries )but i don't know what's wrong why i m not getting the complete tomcat distribution .God knows.i am tired of it now.'will try some time later.
Thanks again.U had been great help.I really appreciate that.
regards
preeti
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
who must be real tired answering my queries
well, kinda used to it with Tomcat starters....
anyways, after going home I will try to verify my
Tomcat installation and let you know what you need.
If not I will email you the "xml.jar" file so you can
proceed....no problem!
meanwhile if you get a chance, enjoy this link. I am
pretty impressed with it. I just copied it here from the
Meaningless Drivel forum, Courtesy ersin....
http://www.b0g.org/crap/fight.swf
regds.
- satya
gayatri reddy
Greenhorn

Joined: Apr 25, 2001
Posts: 7
Hi preeti,
I installed tomcat in my system which is ME.But i was able to install it properly and now working on that too.preeti I am trying to help u.
could u check this
<h2>classpath=;c:\tomcat\lib\SERVLET.JAR;</h2>
the servlet.jar file is in c:\tomcat\common\lib\servlet.jar
check the path.may be this helps u.after setting every restart the computer.
-greddy
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

You DONT have an xml.jar. Thats is the correct download.
I just verified this on my system right now. You should
have jaxp.jar, servlet.jar, ant.jar, jasper.jar, parser.jar and finally webserver.jar
You might want to try what gayatri said abv.
Not sure what the hell ME does.....
regds.
- satya
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: tomcat not running??