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 6982135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:14:53+00:00 2026-05-27T18:14:53+00:00

I have a Servlet class I made to handle functions I don’t want to

  • 0

I have a Servlet class I made to handle functions I don’t want to repeat on every Servlet I have. I’m still working on it (i.e. it still only loads index.jsp and not other files).

public class MyServlet extends HttpServlet {
    public MyServlet () {
        super();
    }

    public void loadView (HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        RequestDispatcher dispatcher = request.getRequestDispatcher("/index.jsp");

        response.setContentType("text/html;charset=UTF-8");

        System.out.println("MyServlet::LoadView() success");

        dispatcher.forward(request, response);
    }
}

My Servlet is as follows

@WebServlet(name = "EditServlet", urlPatterns = {"/content/edit"})
public class EditServlet extends Library.MyServlet {
    public EditServlet () {
        super();
    }

    public void doGet (HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        System.out.println("EditServlet loaded");
    }
}

I am however, unable to compile my code:

SEVERE: Exception while deploying the app [ContentManagement] : (class: contentmanagement/content/EditServlet, method: <init> signature: ()V) Constructor must call super() or this()

update

Ok, removing void on my constructors and calling super(); got the must call first portion to go away, but it’s still saying I have to call super despite that it’s already being called.

update

I don’t understand the responses below…. they keep saying to put super() within the constructor, when my examples already show that being done, AND it is the first line of code. Any other advice would be appreciated.

Any thoughts?

This is now a non-issue. I do not know what resolved this issue, but with multiple changes and rebuilding my app from the ground up I am no longer experiencing this issue

  • 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-05-27T18:14:54+00:00Added an answer on May 27, 2026 at 6:14 pm

    Your problem was:

    method: <init> signature: ()V) Constructor must call super() or this()

    It seems like VerifyError symptom. Cleaning and rebuilding the project should resolve the problem, see also:

    • VerifyError means the bytecode is invalid
    • Perform a “clean and build”

    Furthermore, you can remove your constructors with a super() single-line. The JVM does it for you with a default (implicitly hidden) constructor. So, clear these unnecessary lines:

    public MyServlet () {
        super();
    }
    

    and

    public EditServlet () {
        super();
    }
    

    You would have to explicitly call super() if you needed to write additional business lines in the constructor.

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

Sidebar

Related Questions

I'm working on an application. I have a servlet (writeDataBase.class) that writes some information
I want to send an email from my servlet in jboss. I have made
I have servlet in my web.xml but i don't want my application to load
I have a servlet. But it is not working as desired. Hence for debugging
I have a servlet class which handles login. At the end of my login
I have a Servlet class in which I import javax.servlet.* and javax.servlet.http.* . When
If I have a Servlet class, and this class is used in two applications
I have created a servlet mapping as /reskilling in my Servlet class. When I
I have this servlet: public class SaveImage extends HttpServlet { protected void doGet(HttpServletRequest request,
I have specified my JAX-RS Application in the web.xml as follows: <servlet> <servlet-name>CXFServlet</servlet-name> <servlet-class>

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.