• 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

help with tomcat - 404 cannot find servlets

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone hope I can find some help here. I have switched to Mac OSX( iBook ) in January and was impressed by how great this OS is and so far the switch has been painless. I got up and running with OpenOffice, Apache, PHP, Mysql, successfully compile projects with Eclipse so generally beginning to forget my old PC for good! My only headache has so not having been able to figure out a problem I have with Tomcat 4.1.24. I transferred my web application from my PC but I can only view HTML pages and JSP files. Each time I try to access a servlet I get a message 'HTTP Status 404 -/servlet/ArticleSearchHandler'. Normally this means that the class file is not found but it is there. I have all my files in the ROOT directory ( sorry I am no geek ) and my classes are all in packages in the classes folder.
A web.xml snippet looks something like...

<web-app>

<servlet>
<servlet-name>ArticleContentHandler</servlet-name>
<servlet-class>middleway.ArticleContentHandler</servlet-class>
</servlet>

.......
</web-app>

any help most appreciated, Gianni
 
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
If you are using a URL like "servlet/ArticleSearchHandler' - that would require the "Invoker" servlet. See this discussion of the Invoker.
You really should drop use of the invoker and provide a direct servlet mapping from URL to your servlet name in the web.xml file. Using the invoker causes nothing but trouble for all but the simplest uses.
Bill
 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Gianni,
Have you created the Tomcat contexts for the folders which house the servlets. (you would only need to do this if your servlets are sitting somewhere other then TomcatDirectory/webapps/ folder)

Also, check your JVM. Have you installed the JDK correctly? (It should be JDK and not JRE)

404 error thrown by Tomcat is simply becoz its unable to find the required class as you already figured it out.

The other thing I would check is the file attributes. ( I dont know about Macs but in windows its as simple as right-click & properties).

You can even try recompiling the servlets again using the source java file.

Good Luck !

regards,
Rahul..
 
She said she got a brazillian. I think owning people is wrong. That is how I learned ... tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic