Skip to main content



      Home
Home » Newcomers » Newcomers » Eclipse: HttpServlet cannot be resolve to type, Tomcat: Servlet is working OK
Eclipse: HttpServlet cannot be resolve to type, Tomcat: Servlet is working OK [message #49955] Sat, 09 April 2005 18:16 Go to next message
Eclipse UserFriend
Originally posted by: lukasz.budnik.vega.eti.pg.gda.pl

Hello.

I'm using (trying to use) Eclipse for writing my servlets but
I keep getting this strange error: 'HttpServlet cannot be resolve to type'

and it point to this line:

'public class MyServlet extends HttpServlet {'

When I'm using command line javac everything is OK and Servlet works fine
in Tomcat 5.5.7

I'm using jdk1.5.0_02 - 5.0 and Eclipse Version: 3.1.0 Build id:
I20050219-1500

jdk and Tomcat are new (updated today from apache.org and sun.com)

is it my fault? or is it Eclipse's?

what should I do?

thanks in advance

best regards
Luke
Re: Eclipse: HttpServlet cannot be resolve to type, Tomcat: Servlet is working OK [message #50002 is a reply to message #49955] Sat, 09 April 2005 18:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: myersj.gmail.com

Luke,

Have you added the servlet libraries provided by Tomcat to your Eclipse
project? HttpServlet is most likely not in your build path in Eclipse.
You'll need to get the jar that contains that class and add it as a
library to your Eclipse project.

Hope this helps,
- Jeff

Luke wrote:
> Hello.
>
> I'm using (trying to use) Eclipse for writing my servlets but
> I keep getting this strange error: 'HttpServlet cannot be resolve to type'
>
> and it point to this line:
>
> 'public class MyServlet extends HttpServlet {'
>
> When I'm using command line javac everything is OK and Servlet works
> fine in Tomcat 5.5.7
>
> I'm using jdk1.5.0_02 - 5.0 and Eclipse Version: 3.1.0 Build id:
> I20050219-1500
>
> jdk and Tomcat are new (updated today from apache.org and sun.com)
>
> is it my fault? or is it Eclipse's?
>
> what should I do?
>
> thanks in advance
>
> best regards
> Luke
>
Re: Eclipse: HttpServlet cannot be resolve to type, Tomcat: Servlet is working O [message #50207 is a reply to message #50002] Sun, 10 April 2005 04:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: lukasz.budnik.vega.eti.pg.gda.pl

I'm not that newbie ;-)

I've create libraries for my servlet project:
/usr/jakarta-tomcat-5.5.7/server/lib and
/usr/jakarta-tomcat-5.5.7/common/lib

Eclipse sees that packages - for example code completition works fine

but there's an error on that first line - the definition of class
extending HttpServlet.

best regards
Luke
Re: Eclipse: HttpServlet cannot be resolve to type, Tomcat: Servlet is working O [message #50237 is a reply to message #50207] Sun, 10 April 2005 07:23 Go to previous message
Eclipse UserFriend
Originally posted by: lukasz.budnik.vega.eti.pg.gda.pl

OK it was Eclipse error.

I renamed the file to xxx.java and then back to MyServlet.java and error
disappeared.

weird behaviour

best regards
Luke
Previous Topic:XDoclet dies on stack overflow
Next Topic:md5sum -c eclipse-SDK-3.02-win32.zip.md5 failed
Goto Forum:
  


Current Time: Fri Apr 25 06:34:46 EDT 2025

Powered by FUDForum. Page generated in 0.08156 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top