[ Team LiB ] Previous Section Next Section



Why won't my servlet compile? The compiler reports that it can't find the javax.servlet package.


Your classpath isn't set up correctly. You need to locate the servlet-api.jar file (it might have a different name) and add it to your classpath.


I put my WAR file in Tomcat's webapps directory; why isn't Tomcat unpacking it?


If Tomcat doesn't unpack the WAR file in the webapps directory, look in Tomcat's logs directory for an error or output file. If you are using Tomcat 4.0 or 5.0, look at the catalina.out file. It may contain errors relating to your WAR file. Also, make sure that the file is named .war and not .jar.


Why does the Web server give me a 404 (File Not Found) error or a 500 (Internal Server Error)?


This is usually either an installation problem or a classpath issue. One way to check the installation is to run one of the default servlets that comes with the servlet container. If you can't run one of the defaults, you need to check your servlet container's configuration and possibly reinstall it. If you can run the default servlet, but not your own, your classpath probably doesn't point to your servlet. Also, if you change the classpath after you have started the servlet container, you need to restart the servlet container to pick up the changes.

    [ Team LiB ] Previous Section Next Section