• 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

tomcat won't run my servlet

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm setting up tomcat for the first time, and I've gotten sample HTML and JSP files to load by placing them in the tomcat_home\webapps\ROOT directory and going to http://localhost/Hello.html and Hello.jsp.
However, when I create a classes subdirectory off of tomcat_home\webapps\ROOT\WEB-INF\ and place a servlet class file there, going to http://localhost/serlvet/HelloServlet doesn't work.
The servlet compiles fine, so my CLASSPATH is working, but nothing happens when I try to load that page.
Any ideas as to what might cause this?
Thanks,
Michael
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds like things have been done right so far. If it's small, perhaps you could post your code? Maybe do a simple Hello World servlet to see if that works.
 
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Did you set up your Servlet in web.xml?
/Rene
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
check yo see if you hava a servel jar file in your jdk. I remember having the same problem. Find a sevlet.jar file wherever you can find it and put it in jdk... mine is C:\jdk1.3.1\jre\lib\ext\servlet.jar. Don't also forget to update your classpath.
good luck!
 
Ranch Hand
Posts: 1514
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kablan, it would not even compile if servlet.jar was not in the right place.
Try specifying the port number as in... http://localhost:8080/serlvet/HelloServlet
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic