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
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
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
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).]
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.
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
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.
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
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
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: 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.
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!!