I have recently installed Tomcat 6.0.29 on my Ubuntu 10.04 system. Process till the localhost connectivity is fine but when I tried to run a simple hello program, it giving me the following error:
type Status report
message /opt/apache-tomcat-6.0.29/webapps/examples/WEB-INF/classes/HelloWorldExample
description The requested resource (/opt/apache-tomcat-6.0.29/webapp开发者_StackOverflow社区s/examples/WEB-INF/classes/HelloWorldExample) is not available.
I have tried to reinstall tomcat by the different methods give on other sites but the result is same. I am not yet sure where I am going wrong. Please can anyone describe me the correct method of running a servlet program ie, where to store the actual Java and class files.
- Have you got a correct
web.xml
file? It needsservlet
andservlet-mapping
tags. - Check that WAR file from which you deployed your web-app is not corrupted.
always put you class in package, eg, not HelloWorldExample
, but foo.HelloWorldExample
.
Tomcat (and other containers as well) doesn't like default packages.
精彩评论