This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes tomcat startup problem.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "tomcat startup problem.." Watch "tomcat startup problem.." New topic
Author

tomcat startup problem..

karan, chopra
Ranch Hand

Joined: Jun 05, 2001
Posts: 115
hi all,
i have installed tomcat recently and following are my environment variables:
path - existing path;h:\tomcat\jakarta\bin;
classpath - existing path;h:\jdk1.3\bin;
JAVA_HOME - h:\jdk1.3;
TOMCAT-HOME - h:\tomcat\jakarta;
ANT_HOME - h:\tomcat\jakarta;
ie my tomcat stuff is dumped in h:\tomcat\jakarta\...now the problem is whenever i try to execute the server by double clicking the startup.bat file then nothing happens,ie no window shows up..i even tried executing it from the dos prompt by coming in to the appropriate directory(ie the bin directory) and then typing startup..but on doing this i get an error which says "the system cannot find the path specified"..i dont know why because when i do dir in the bin directory then it does show the startup.bat file in it but on executing the startup.bat it just throws up this error...what do i do..please help..
also i want to know that if i want to execute a servlet on tomcat then where do i put the class file of the servlet in tomcat and do i have to make any more changes in order to execute the servlet?
PS - i have changed the default port to 8000 in the server.xml file..
thanks a lot in advance
regards
karan
Jimi Rock
Ranch Hand

Joined: Feb 19, 2001
Posts: 134
Hi,
*You don't need to change the port. it should be 8080 as I know.
*Try to right click on your dos prompt title bar->properties->memory. and set the starting memory to 4096 or above.
*change directory to the bin directory of tomcat. then type :
tomcat start. it will work as I hope
*you need to put your servlets *.class files under the following path:
tomcat_home\webapps\examples\web-inf\classes
Regards,
Jimi
karan, chopra
Ranch Hand

Joined: Jun 05, 2001
Posts: 115
hi jimi,
i tried to do whatever u said and followig are some queries:
1.)i changed the port number because i also have jsdk in my computer and its running on 8080,so i didnt want any conflict between jsdk and tomcat.
2.)when i go to the properties of the dos window i dont see any memory option, all i see is option,font,layout and color and none of these individually have the memory option..so please elaborate on what u said..
3.)on typing tomcat start in the bin direstory of tomcat i get an error saying that "unable to locate servlet.jar,check the value of TOMCAT_HOME"..but as u can see in my previous post above i have given TOMCAT_HOME as h:\tomcat\jakarta; and all the directories,ie,bin,conf etc are in jakarta,but on checking i found the servlet.jar file in h"\tomcat\jakarta\lib..so how should i change my TOMCAT_HOME so that my server starts?
4.)lastly i have installed tomcat 3.2.2 and it doesnt have any directories under the webapps director,it just has 4 *.war files in the webapps dir..so should imanually create all the directories that u mentioned in the webapps directory in order to
put my servlet.class file in them?
looking forward to the reply
thanks a lot
regards
karan
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

Your problem should be solved by removing the semicolons from your environment variables. Semicolons are used to separate entries in a variable assignment, so for PATH and CLASSPATH, there is no need for the trailing semicolon (only use one between entries), and for all the rest, don't use one at all.

When Tomcat starts up, it unpackages the 4 WAR files into those directories mentioned, so don't bother creating them. Once you are able to start Tomcat once, those directories will be there.
[This message has been edited by Mike Curwen (edited June 15, 2001).]
Jimi Rock
Ranch Hand

Joined: Feb 19, 2001
Posts: 134
Hi,
*Sorry I thought that you are under windows 98. but it seems that you are under 2000 or NT as I think. so, you don't need to change any thing related to memory.
*I wonder why are you using jsdk as it is obsolete now. use tomcat only.
*Try to follow Mike's suggestion and tell if problem occured.
Regards,
Jimi.
karan, chopra
Ranch Hand

Joined: Jun 05, 2001
Posts: 115
hi jimi,
everything is working fine now and my tomcat server is starting,there is just one hiccup,it being that where should i put my java class files becaue i have tried putting it in webapps/examples/webinf/classes but it didnt work...i mean which URl should i give if i put my class files in this dir..because in jsdk if i put the class files in the webpages/webinf/servlets/ dir then the URl is localhost:8080/servlet/servlet name..so in this case what should be the URl?
thanks again
regards
karan
Jimi Rock
Ranch Hand

Joined: Feb 19, 2001
Posts: 134
Karan,happy because your tomcat is finally working.
I see your current problem. You put your java classes in the same path as I told you. but when calling them, use the following URL:
http://localhost:8080/examples/servlet/YourClassFileName
tell if problems occured again.
Regards,
Jimi.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
1. Be sure to remove all traces of JSDK files - I spent days trying to trace a problem due to jsdk.jar hanging around.
2. Download the Servlet API 2.2 file from java.sun.com - this is the definative statement on how Java web applications should be organized. If you are going to be doing JSP, get the JSP API 1.1 also.
3. Study the examples that come with Tomcat, especially how they are described in the web.xml files and how the class files are organized.
Bill
karan, chopra
Ranch Hand

Joined: Jun 05, 2001
Posts: 115
hi jimi and william,
my problems are finally sorted out and everythings working perfectly fine now..special thanks to mike curwen for guiding me at every step...cheers guy..keep up the good work..
regards
karan
Jimi Rock
Ranch Hand

Joined: Feb 19, 2001
Posts: 134
Happy because your problem is solved, keep in mind that the life is a set of "solvable" problems
Regards,
Jimi.
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

Just so the others don't feel left out, karan and I were emailing back and forth off the ranch... So that's why she mentioned me when it appears I didn't post anything for a while.
karan, chopra
Ranch Hand

Joined: Jun 05, 2001
Posts: 115
just to correct u mike..i am a HE and not a SHE..but i dont blame u coz the world we live in is big and heterogenous.. and names can get very confusing at times
take it easy
karan
Jimi Rock
Ranch Hand

Joined: Feb 19, 2001
Posts: 134
Karan, I have noticed this. but don't like to tell.
also, note that people can use aliases names, as my case.
No one can guess that I am a girl as I am using the name "Jimi" that I like.
We are all friends regardless of any thing.
Regards.
karan, chopra
Ranch Hand

Joined: Jun 05, 2001
Posts: 115
i guess u r right jimmi...cheers
Max Rahder
Ranch Hand

Joined: Nov 06, 2000
Posts: 177
Karan:
Your note states that you set the environment variable "TOMCAT-HOME". I think Tomcat expects the variable to be named "TOMCAT_HOME". In other words, use the underscore character and not a hyphen. I recommend you put a "pause" as the last line in the ".bat" file. This will keep the DOS window visible so you see any feedback or error messages generaged by Tomcat.
DC Dalton
Ranch Hand

Joined: May 28, 2001
Posts: 287
Hi Guys.....Ive been following along with this thread because I too havent been able to get any of my servlets to run since you helped me get Tomcat going & I figured why waste a thread if this one will answer my questions. But alas this is not to be. The example servlets work just dandy but even my "Hello world" servlet blows to bits. I have my class files in webapps\examples\web-inf\classes just like you metioned above. I am past the 404 file not found errors though I dont know if it is progress or not. Now I am getting an exception that I think has to do with the way I have Tomcat set up. Here is the exception & remember this is just a hello world servlet, nothing fancy:
java.lang.IllegalAccessException: TryingOutThisThing
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:237)
at org.apache.tomcat.core.ServletWrapper.loadServlet(ServletWrapper.java:268)
at org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:289)
at org.apache.tomcat.core.Handler.service(Handler.java:254)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
at java.lang.Thread.run(Thread.java:484)
Any brilliant suggestions for this little wonder........BTW I am in fact running the dreaded win98!!
DC Dalton
Ranch Hand

Joined: May 28, 2001
Posts: 287
Please ignore the last post......Took a hot shower & it dawned on me....either Im an idiot or Ive been hitting the books way to hard lately......thanks anyways!!!
Jimi Rock
Ranch Hand

Joined: Feb 19, 2001
Posts: 134
Dalton, note that you can delete your post if you don't like people to look at it. this could be done by clicking the third icon that appears in your post title bar
Regards,
Jimi.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: tomcat startup problem..
 
Similar Threads
Trying to find javax, to compile Tomcat servlet
tomcat installation problem
Trying to find javax, to compile Tomcat servlet
Tomcat Installation
Win98SE & Tomcat 4 setup problem