This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
What it means is that the Servlet API classes are not being found on your classpath. May be there is some spelling mistake in the classpath you specify. or you may want to copy servlet-api.jar (make sure it contains the 'servlet' classes, just in case) to a specially created directory for jars, such as c:\jars, and set the classpath to that location.
Your problem is pertaining to the class path not being set to the place where the servlet.jar file is located.
In your system, go to
1. CATALINA_HOME/commons/lib directory.
2. Check whether the servlet.jar file is existing.
3. If it is there, set the Environment variable classpath = %CATALINA_HOME%\commons\lib\servlet.jar; 4. Restart your Tomcat... It should work fine.
If you don't have, just load the servlet.jar down and place it in ur lib directory. That should work. In case of troubles, you know where to come.
Joined: Sep 30, 2004
sorry guys..for starting each time new thread..just registered myself to the site yesterday after facing this problem..so cudnt get familiar with its working..
i have given the commands as follows..
set classpath=c:\Tomcat5.0\common\lib\servlet-api.jar,%classpath% set path=c:\jsdk1.4\bin;%path% javac c:\pr1\src\chservlet.java
getting the following errors
C:\>javac c:\pr1\src\chservlet.java c:\pr1\src\chservlet.java:1: package javax.servlet does not exist import javax.servlet.*; ^ c:\pr1\src\chservlet.java:2: package javax.servlet.http does not exist import javax.servlet.http.*; ^ c:\pr1\src\chservlet.java:5: cannot resolve symbol symbol : class HttpServlet location: class chservlet public class chservlet extends HttpServlet ^ c:\pr1\src\chservlet.java:7: cannot resolve symbol symbol : class HttpServletRequest location: class chservlet public void doGet(HttpServletRequest req,HttpServletResponse res) throws IOExcep tion ^ c:\pr1\src\chservlet.java:7: cannot resolve symbol symbol : class HttpServletResponse location: class chservlet public void doGet(HttpServletRequest req,HttpServletResponse res) throws IOExcep tion ^ 5 errors
was just wondering.ihave windows xp..so does it effect in anyway(it shud not) and if name of the servlet is given wrong then it shudnt give these set of errors..it shud give kind a"cudnt find the file name" and i have checked the classpath..servlet-api.jar is present and is in this location c:\Tomcat 5.0\common\lib
and i had tried giving the command jar -tvf servlet-api.jar.. it gives the list of classes..which shows..its present in the directory