• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

william, help needed

 
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 159
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
typo above:
its http://localhost:8080/HelloWorld
awaiting help
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"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
Posts: 159
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 159
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"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
 
get schwifty. tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic