File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes william, help needed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "william, help needed" Watch "william, help needed" New topic
Author

william, help needed

chetan nain
Ranch Hand

Joined: Jun 21, 2000
Posts: 159
friends,
i have the jdk1.3 on my machine, and i just downloaded tomcat, which i installed in the c:\tomcat dir. here is my autoexec.bat file:

set CLASSPATH=.;C:\jdk1.3\bin
PATH=%PATH%;.;c:\jdk1.3\bin;c:\tomcat\bin
set CLASSPATH=%CLASSPATH%;.;c:\jdk1.3\lib\tools.jar
set JAVA_HOME=c:\jdk1.3
set TOMCAT_HOME=c:\tomcat
set CLASSPATH=;c:\tomcat\lib\servlet.jar
set CLASSPATH=%CLASSPATH%;.;c:\tomcat\lib\tools.jar
set CLASSPATH=.;C:\jdk1.3\lib\tools.jar
please forgive the repetitions, but i am just making sure.
1. earlier, i was having a problem compiling the programs, so i copied the servlets.jar file from c:\tomcat\lib into the c:\jdk1.3\..\ext directory. the programs compile fine now.
2. when i start up tomcat using startup, (ie i double click on the file), a new dos window comes up, after which another window flashes up for less than a second (but the first window remains open). can i say that tomcat is running??? also,after thesocalled startup, when i type shutdowm, iget an error like, connectionrefused, or such. is tomcat running or not??
3. if yes, i put one of my programs in the c:\ direcotry called HelloWorld.java and compiled it. now, when i try to run the same by typoing in my browser http://localhost:8080//Helloworld i get the 'document contained no datat' error.
what exactly is the proc for running servlets??
i am totally confused and tired . please hlp me out

chetan
chetan nain
Ranch Hand

Joined: Jun 21, 2000
Posts: 159
typo above:
its http://localhost:8080/HelloWorld
awaiting help
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12821
    
    5
"2. when i start up tomcat using startup, (ie i double click on the file), a new dos window comes up, after which another window flashes up for less than a second (but the first window remains open). can i say that tomcat is running???"
Number one rule for running Tomcat: DON'T start it by doubleclick on the BAT file.
Instead, open a MSDOS prompt window, cd to the tomcat/bin directory and then execute startup.bat.
IF running in Win95 or Win98, you will have to increase the environment space OR Tomcat will run out of environment space and die - the 2nd window will close, leaving you wondering what happened.
To increase environment space - with a MSDOS prompt window, right click in the upper left corner, get the properties dialog, Memory tab. Change the Initial Environment number to 4096.
The reason being that the Tomcat startup batch files set some huge environment variables.
You may want to comment out the @echo off line in startup.bat and tomcat.bat so you can see error messages.
ONLY after you can run both the Tomcat sample servlets and the sample JSP should you try to run your own servlets. Study the web.xml files and the documentation provided by Tomcat.
Bill
chetan nain
Ranch Hand

Joined: Jun 21, 2000
Posts: 159
thank you william, you were very prompt.
the server is running now.
i typed tomcat run instead of startup
one more question, is there a particular directory we have to place our servelts in? (like c:\tomcat\webapps\test)??
or can we place in any dir(by changing the web.xml params?)
or please point me to resources

thanks
chetan nain
Ranch Hand

Joined: Jun 21, 2000
Posts: 159
William,
thank you very much for your help. i really appreciate the time you take to answer queries
chetan
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12821
    
    5
"one more question, is there a particular directory we have to place our servelts in? (like c:\tomcat\webapps\test)??"
The v 2.2 Java servlet API goes into a LOT of detail about where files should be placed and the contents of the web.xml file(s) are essential. You should download the API from java.sun.com as it is too complicated to go into here.
The Tomcat Docs and example applications should also be studied.
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: william, help needed