• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

requested servlet is not available  RSS feed

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sir I have got some error's when i run my first servlet program with Tomcat 6

Errors : HTTP Status 404 -
type Status report

message:

description: The requested resource () is not available.

my java code is :



XML code is :



class directory :C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\myApp\WEB-INF\classes\TestingServlet.class

I have run the servlet with url :http://localhost:8080/myApp/servlet/Testing

 
Sheriff
Posts: 67257
170
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does this have to do with Applets?
 
Ranch Hand
Posts: 874
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dhanil,

Welcome to Javaranch.Please choose correct forum before posting.

Two Mistakes
- Use package always to write your servlet programs. so <servlet-class> would change as com.dhanil.TestingServlet


- Use web-app that suits your container. Tomcat 6 i believe would support lower versions , 2.4 and higher as well.

 
Bear Bibeault
Sheriff
Posts: 67257
170
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, please be sure to take the time to compose descriptive subjects for your posts; read this for more information.

Using a title of "servlet" in a forum completely dedicated to questions on Servlets isn't very helpful.

I've changed the subject for you and moved this to the Servlets forum.
 
author and jackaroo
Posts: 12199
280
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

dhanil das wrote:XML code is :
[snip]

I have run the servlet with url :http://localhost:8080/myApp/servlet/Testing


According to this, when you enter the URL of http://localhost:8080/myApp/servlet/Testing, Tomcat will look for a servlet-mapping with the url-pattern of /Testing - there is no such url-pattern in the web descriptor. I assume you really meant to enter http://localhost:8080/myApp/servlet/TestingServlet, for which there is a matching url-pattern.

When you enter http://localhost:8080/myApp/servlet/TestingServlet, it will find a servlet-mapping with that url-pattern, and then try to find a servlet with the servlet-name of TestingServlet. There is no such servlet - either the servlet-name in the servlet section needs to be updated, or the servlet-name in the servlet-mapping needs to be updated.

Balu Sadhasivam wrote:
Use package always to write your servlet programs. so <servlet-class> would change as com.dhanil.TestingServlet
...
Use web-app that suits your container. Tomcat 6 i believe would support lower versions , 2.4 and higher as well


Very good advise, however these will not solve the fundamental issues of the XML fragments being incorrect. Personally I would recommend you fix the XML and confirm that it is working, then go back to fix code style issues.
 
Evil is afoot. But this tiny ad is just an ad:
ScroogeXHTML - small and flexible RTF to HTML converter library
https://coderanch.com/t/710903/ScroogeXHTML-RTF-HTML-XHTML-converter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!