Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8617231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:48:23+00:00 2026-06-12T05:48:23+00:00

Servlet not working in newly created Dynamic Web Project in Eclipse Juno for Java

  • 0

Servlet not working in newly created Dynamic Web Project in Eclipse Juno for Java EE. Here is how it goes, from scratch:

  • I downloaded Eclipse EE (Juno), didn’t change any of default config
  • I downloaded latest Tomcat (7.0.30)
  • In Preferences > Server > Runtime Environments I added new Apache Tomcat v7.0
  • I created new Dynamic Web Project called UniBudget (context root: budget)
  • I added new file (index.jps with “it works!” inside)

At this moment after adding project to server and running it I could see “it works!” on screen. So, deployment works.

  • Next I added servlet file (control.Controller.java):

    package control;
    
    import java.io.IOException;
    import javax.servlet.ServletException;
    import javax.servlet.annotation.WebServlet;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    
    @WebServlet({ "/Controller", "*.do" })
    public class Controller extends HttpServlet {
        private static final long serialVersionUID = 1L;
    
        public Controller() {
            super();
        }
    
        protected void doGet(HttpServletRequest request,
                HttpServletResponse response) throws ServletException, IOException {
            System.out.println("doGet()");
        }
    
        protected void doPost(HttpServletRequest request,
                HttpServletResponse response) throws ServletException, IOException {
            System.out.println("doPost()");
        }
    
    }
    
  • I changed index.jsp to look like this, nothing more:

    <jsp:forward page="/departments.do"/>
    
  • And of course web.xml:

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
    id="WebApp_ID" version="3.0">
        <display-name>UniBudget</display-name>
        <welcome-file-list>
            <welcome-file>index.html</welcome-file>
            <welcome-file>index.htm</welcome-file>
            <welcome-file>index.jsp</welcome-file>
                <welcome-file>default.html</welcome-file>
                <welcome-file>default.htm</welcome-file>
            <welcome-file>default.jsp</welcome-file>
        </welcome-file-list>
    
        <!-- servlet definition -->
        <servlet>
            <servlet-name>Do</servlet-name>
            <servlet-class>control.Controller</servlet-class>
        </servlet>
        <!-- servlet mapping -->
        <servlet-mapping>
            <servlet-name>Do</servlet-name>
            <url-pattern>*.do</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
            <servlet-name>Do</servlet-name>
            <url-pattern>/Controller</url-pattern>
        </servlet-mapping>
    </web-app>
    
  • Generated .class files have to be in WEB-INF/classes right? That’s what I read. So: Configure Build Path > Source tab > Browse > I created classes folder in WEB-INF (in Advanced I linked to folder in file system: ... /UniBudget/build/classes)

  • This is the file hierarchy in project:

file hierarchy in project

  • I cleaned and built the UniBudget project and republished to server. Cleaned the server.

  • I thought I would work now (I mean displaying “doGet()” or “doPost()” in Console). But instead of printout in Console I got this error:

    HTTP Status 404 - /budget/departments.do
    
    --------------------------------------------------------------------------------
    
    type: Status report
    
    message: /budget/departments.do
    
    description: The requested resource is not available.
    
  • the same happens when I try to directly access http://localhost:8080/budget/Controller (without redirection from index.jsp)

It looks like Eclipse could not see the servlet at all! Could you please point me where I make the mistake? I can’t figure this out for hoours now.


EDIT:

After removing redundant annotation (@WebServlet), another error occurs:

HTTP Status 503 - Servlet Do is currently unavailable

--------------------------------------------------------------------------------

type Status report

message Servlet Do is currently unavailable

description The requested service is not currently available.

Error in console:

wrz 24, 2012 9:34:15 PM org.apache.catalina.core.ApplicationDispatcher invoke
WARNING: Servlet Do is currently unavailable

Not much. But that’s all.


EDIT:

I found yet another error taking place here. I’m not even sure how to recreate it, but at least this one provides some more log info:

HTTP Status 500 - An exception occurred processing JSP page /index.jsp at line 3

--------------------------------------------------------------------------------

type: Exception report

message: An exception occurred processing JSP page /index.jsp at line 3

description: The server encountered an internal error that prevented it from fulfilling this request.

exception: 

org.apache.jasper.JasperException: An exception occurred processing JSP page /index.jsp at line 3

1: <%@ page language="java" contentType="text/html; charset=UTF-8"
2:     pageEncoding="UTF-8"%>
3: <jsp:forward page="/departments.do"/>


Stacktrace:
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:455)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)


root cause: 

javax.servlet.ServletException: Error instantiating servlet class control.Controller
    org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:746)
    org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:716)
    org.apache.jsp.index_jsp._jspService(index_jsp.java:65)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)


root cause: 

java.lang.ClassNotFoundException: control.Controller
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
    org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:746)
    org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:716)
    org.apache.jsp.index_jsp._jspService(index_jsp.java:65)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

EDIT:

Error during project right click > Export > WAR file:

java.lang.NoClassDefFoundError: org/eclipse/wst/web/internal/deployables/IFlatDeployable
    at org.eclipse.jst.j2ee.internal.archive.operations.JavaEEComponentExportOperation.getModuleParticipants(JavaEEComponentExportOperation.java:77)
    at org.eclipse.jst.j2ee.internal.archive.operations.JavaEEComponentExportOperation.getParticipants(JavaEEComponentExportOperation.java:43)
    at org.eclipse.jst.j2ee.internal.archive.operations.JavaEEComponentExportOperation.createFlatComponentArchiver(JavaEEComponentExportOperation.java:91)
    at org.eclipse.jst.j2ee.internal.archive.operations.ComponentExportOperation.export(ComponentExportOperation.java:191)
    at org.eclipse.jst.j2ee.internal.archive.operations.ComponentExportOperation.execute(ComponentExportOperation.java:136)
    at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl$1.run(DataModelPausibleOperationImpl.java:385)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
    at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.runOperation(DataModelPausibleOperationImpl.java:410)
    at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.runOperation(DataModelPausibleOperationImpl.java:360)
    at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.doExecute(DataModelPausibleOperationImpl.java:247)
    at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.executeImpl(DataModelPausibleOperationImpl.java:219)
    at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.cacheThreadAndContinue(DataModelPausibleOperationImpl.java:89)
    at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.execute(DataModelPausibleOperationImpl.java:207)
    at org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizard$1CatchThrowableRunnableWithProgress.run(DataModelWizard.java:220)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T05:48:25+00:00Added an answer on June 12, 2026 at 5:48 am
    java.lang.NoClassDefFoundError: org/eclipse/wst/web/internal/deployables/IFlatDeployable
    

    Whoops. That’s a pretty serious error, this class is namely internal to Eclipse. This has been reported once as Eclipse issue 388698, but this was unfortunately closed off as WORKSFORME. This seems to be an environment/platform/configuration specific problem after all. I’d consider re-posting the same issue along with as much as possible detail about the environment used (OS make/version, JRE/JDK make/version, hardware specs, etc).

    I have personally not tried Juno yet (I usually wait for a SR1 to be released around winter so that all major teething issues are covered), but if completely deleting the Eclipse installation and re-unzipping it doesn’t work, then I’d suggest to try to step back to the previous Eclipse version, which is Indigo SR2. Make sure that you download the right version for your platform (32bit vs 64bit).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I added Comet servlet into Spring web application. This servlet does not differ from
C:\Tomcat5.5\webapps\WEB-INF\classes>javac MyServlet.java MyServlet.java:2: package javax.servlet does not exist import javax.servlet.*; ^ MyServlet.java:3: package javax.servlet.http
I have 3 projects. One is a Servlet (made inside a Dynamic Web Project),
I am trying to implement a simple login servlet but it's not working properly.
I have a servlet. But it is not working as desired. Hence for debugging
I have a Filter Servlet that filters request from a Servlet. I do not
I am working on the jsp/servlet/ajax application. I use XMLHttpRequest to pass values from
I have memory leak in the web application (servlet) that I am working on.
My $.getJSON method is calling the servlet but callback function is not working. this
I am trying to run two Servlet-class in a single web.xml but its not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.