• 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 6 returning an HTTP 404

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to deploy a simple, one servlet, web service to Tomcat 6 and every attempt to invoke the service produces an HTTP 404 "The requested resource (/GetData) is not available."

my web.xml contains the following:
<servlet>
<servlet-name>DataProviderServlet</servlet-name>
<display-name>DataProviderServlet</display-name>
<servlet-class>org.mycompany.servlet.DataProvider</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>DataProviderServlet</servlet-name>
<url-pattern>/GetData</url-pattern>
</servlet-mapping>

After deployment my apps file system in Tomcat looks like:
apache-tomcat.6.0.24
webapps
DataProvider
WEB-INF
classes
org
mycompany
servlet
DataProviderServlet.class

I'm trying to invoke the service with http://localhost:8888/getData?...some params...

My servlet has an init method that writes some text to standard out and I do see this text during Tomcat startup so I'm sure Tomcat is finding the class, loading it and calling the init() method. And in my Tomcat.log I see:
INFO main org.apache.catalina.startup.HostConfig - Deploying web application directory DataProvider.


Can anyone spot what I've done wrong?

Thanks for any help and/or advice

-=beeky
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your deployment descriptor and class name do not match.

Please use code tags when posting snippets. Your folder hierarchy, for example, is pretty useless without indentation.
 
William Stafford
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bear,
Thanks for the reply.

-=b
 
Bear Bibeault
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you see the error?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic