This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes IDEs, Version Control and other tools and the fly likes The type HttpServlet is not accessible 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 » Engineering » IDEs, Version Control and other tools
Bookmark "The type HttpServlet is not accessible" Watch "The type HttpServlet is not accessible" New topic
Author

The type HttpServlet is not accessible

victor chiong
Ranch Hand

Joined: Apr 04, 2012
Posts: 73
Hi Guys,

Have you encountered the problem below? It is found in public class BeerSelect extends HttpServlet. Any Idea how to solve this problem? I used the Tomcoat 7 Servlet Jar.

Access restriction: The type HttpServlet is not accessible due to restriction on required library C:
\Apache 7\lib\servlet-api.jar
- Breakpoint:BeerSelect

I am using eclipse Juno Release


package com.example.web;


import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;


/**
* Servlet implementation class BeerSelect
*/

public class BeerSelect extends HttpServlet {
private static final long serialVersionUID = 1L;

/**
* @see HttpServlet#HttpServlet()
*/
public BeerSelect() {
super();
// TODO Auto-generated constructor stub
}

/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {


response.setContentType(null);





// TODO Auto-generated method stub
}

}
mallikarjun dontamsetti
Ranch Hand

Joined: Mar 18, 2011
Posts: 243

I think there should not be any constructor for your servlet extended class.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41088
    
  43
Indeed, servlets should not have constructors, but that's not the problem here.


Ping & DNS - my free Android networking tools app
victor chiong
Ranch Hand

Joined: Apr 04, 2012
Posts: 73
Hi Gurus,

It is actually the auto generated servlet from Eclipe Juno Edition. Even the constructor is auto generated... It is very weird..... How am I not allowed to extend the super class httpservlet right?
 
 
subject: The type HttpServlet is not accessible
 
Similar Threads
problem while executing the JAR written using ANT
java don't compile my servlet.
Download file from Mysql database
HTTP method GET is not supported by this URL
Error to import javax.servlet.*