It's not a secret anymore!*
The moose likes Tomcat and the fly likes package javax.servlet error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "package javax.servlet error" Watch "package javax.servlet error" New topic
Author

package javax.servlet error

Gayani Kanchana
Greenhorn

Joined: Mar 27, 2007
Posts: 19
i have developed a web application using netbeans 5.5(use jdk 1.6). when i tried to build it using apcahe tomcat 5.5 server it gives me this error
"package javax.servlet does not exist"

this is the stack trace

E:\newCRM\newCRM\CRM2\src\com\xont\crm\dao\IssueDAO.java:3: warning: com.sun.org.apache.regexp.internal.RESyntaxException is Sun proprietary API and may be removed in a future release
import com.sun.org.apache.regexp.internal.RESyntaxException;
E:\newCRM\newCRM\CRM2\src\com\xont\crm\web\CustomerSelectionServlet.java:6: package javax.servlet.http does not exist
import javax.servlet.http.HttpServlet;
E:\newCRM\newCRM\CRM2\src\com\xont\crm\web\CustomerSelectionServlet.java:7: package javax.servlet.http does not exist
import javax.servlet.http.HttpServletRequest;
E:\newCRM\newCRM\CRM2\src\com\xont\crm\web\CustomerSelectionServlet.java:8: package javax.servlet.http does not exist
import javax.servlet.http.HttpServletResponse;
E:\newCRM\newCRM\CRM2\src\com\xont\crm\web\CustomerSelectionServlet.java:9: package javax.servlet does not exist
import javax.servlet.ServletException;
E:\newCRM\newCRM\CRM2\src\com\xont\crm\web\CustomerSelectionServlet.java:10: package javax.servlet does not exist
import javax.servlet.RequestDispatcher;
E:\newCRM\newCRM\CRM2\src\com\xont\crm\web\CustomerSelectionServlet.java:30: cannot find symbol
symbol: class HttpServlet
public class CustomerSelectionServlet extends HttpServlet {
E:\newCRM\newCRM\CRM2\src\com\xont\crm\web\DisplayIssueDetailsServlet.java:6: package javax.servlet.http does not exist
import javax.servlet.http.HttpServlet;
E:\newCRM\newCRM\CRM2\src\com\xont\crm\web\DisplayIssueDetailsServlet.java:7: package javax.servlet.http does not exist
import javax.servlet.http.HttpServletRequest;
E:\newCRM\newCRM\CRM2\src\com\xont\crm\web\DisplayIssueDetailsServlet.java:8: package javax.servlet.http does not exist
import javax.servlet.http.HttpServletResponse;
E:\newCRM\newCRM\CRM2\src\com\xont\crm\web\DisplayIssueDetailsServlet.java:9: package javax.servlet does not exist
import javax.servlet.ServletException;
E:\newCRM\newCRM\CRM2\src\com\xont\crm\web\DisplayIssueDetailsServlet.java:10: package javax.servlet does not exist
import javax.servlet.RequestDispatcher;
E:\newCRM\newCRM\CRM2\src\com\xont\crm\web\DisplayIssueDetailsServlet.java:26: cannot find symbol
symbol: class HttpServlet
public class DisplayIssueDetailsServlet extends HttpServlet {
E:\newCRM\newCRM\CRM2\src\com\xont\crm\web\DisplayIssueDetailsServlet.java:31: cannot find symbol
symbol : class HttpServletRequest
location: class com.xont.crm.web.DisplayIssueDetailsServlet
public void doPost (HttpServletRequest request, HttpServletResponse response)
E:\newCRM\newCRM\CRM2\src\com\xont\crm\web\DisplayIssueDetailsServlet.java:31: cannot find symbol
symbol : class HttpServletResponse
location: class com.xont.crm.web.DisplayIssueDetailsServlet
public void doPost (HttpServletRequest request, HttpServletResponse response)
E:\newCRM\newCRM\CRM2\src\com\xont\crm\web\DisplayIssueDetailsServlet.java:32: cannot find symbol
symbol : class ServletException
location: class com.xont.crm.web.DisplayIssueDetailsServlet
throws ServletException, IOException {
E:\newCRM\newCRM\CRM2\src\com\xont\crm\web\EmployeeSelectionServlet.java:6: package javax.servlet.http does not exist
import javax.servlet.http.HttpServlet;
E:\newCRM\newCRM\CRM2\src\com\xont\crm\web\EmployeeSelectionServlet.java:7: package javax.servlet.http does not exist
import javax.servlet.http.HttpServletRequest;
E:\newCRM\newCRM\CRM2\src\com\xont\crm\web\EmployeeSelectionServlet.java:8: package javax.servlet.http does not exist
import javax.servlet.http.HttpServletResponse;
E:\newCRM\newCRM\CRM2\src\com\xont\crm\web\EmployeeSelectionServlet.java:9: package javax.servlet does not exist
import javax.servlet.ServletException;
E:\newCRM\newCRM\CRM2\src\com\xont\crm\web\EmployeeSelectionServlet.java:10: package javax.servlet does not exist
import javax.servlet.RequestDispatcher;
E:\newCRM\newCRM\CRM2\src\com\xont\crm\web\EmployeeSelectionServlet.java:26: cannot find symbol
symbol: class HttpServlet
public class EmployeeSelectionServlet extends HttpServlet {
E:\newCRM\newCRM\CRM2\src\com\xont\crm\web\EmployeeSelectionServlet.java:31: cannot find symbol
symbol : class HttpServletRequest
location: class com.xont.crm.web.EmployeeSelectionServlet
public void doPost (HttpServletRequest request, HttpServletResponse response)

pls help

thanks
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Tomcat doesn't build anything.

It sounds like you don't have your IDE configured correctly.
Specifically, it doesn't have servlet-api.jar in its classpath.

I'm going to move this to our IDEs forum which is the best place to discuss IDE configuration.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: package javax.servlet error
 
Similar Threads
package does not exist problem
Tomcat not loading its jars to classpath at run time
java don't compile my servlet.
package javax.servlet error
Unable to import