• Post Reply Bookmark Topic Watch Topic
  • New Topic

HTTP Status 404 - /myApp/servlet/Testing  RSS feed

 
Kannan Raju
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have installed Tomcat 5.0 and it is working fine. Then I wrote a small servlet and followed all the instruction correctly (I hope). When I run the servlet in the browser, it says

HTTP Status 404 - /myApp/servlet/Testing

But, at the same time the sample application given by Tomcat, runs fine.
Please let me know how to fix this. Thanks.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What instructions had you put "servlet" in your URL?

Did you create a servlet entry in your web.xml with a mapping?
Did you compile the servlet?
Where did you put the servlet class file?
 
Kannan Raju
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What instructions had you put "servlet" in your URL?

Did you create a servlet entry in your web.xml with a mapping?
Did you compile the servlet?
Where did you put the servlet class file?

----------
Yes, I created servlet entry in web.xml.
I compiled the servlet.
I put servlet java and class file in the classes dir under WEB-INF.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kannan, if you really want people here to help you, you're going to have to put a little more effort into your posts. No one here is a mind-reader.

Yes, I created servlet entry in web.xml.


Post the servlet and the mapping entries from your web.xml. We can't guess what they are.


I put servlet java and class file in the classes dir under WEB-INF.


The java file is unnecessary. Is the servlet in a package? It must be.
 
Kannan Raju
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Sorry for providing insufficient info before.

1) My web.xml is in
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\myApp\WEB-INF\web.xml


web.xml
-------

<!DOCTYPE web-app (View Source for full doctype...)>
- <web-app>
- <servlet>
<servlet-name>Testing</servlet-name>
<servlet-class>TestingServlet</servlet-class>
</servlet>
</web-app>


2) myApp directory is under Tomcat5.5

3) TestingServlet.class is in C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\myApp\WEB-INF\classes

please send me an e-amil if you need any other info, in order to solve this. I am still getting 404 error. Thanks.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) You have no URL mapping for your servlet.

2) Your servlet must be in a package other than the default.
 
Kannan Raju
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bear. Also, I used few capital letters when I was creating dir for my application. It didn't accept that.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!