wood burning stoves 2.0*
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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: 41627
    
  55
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?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: The type HttpServlet is not accessible