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

  • Home
  • SEARCH
  • 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 8471599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:50:27+00:00 2026-06-10T16:50:27+00:00

In my servlet I do: request.getRequestDispatcher(/page.jsp).forward(request,response); I get the following NullPointerException on Tomcat 6,

  • 0

In my servlet I do:

request.getRequestDispatcher("/page.jsp").forward(request,response);

I get the following NullPointerException on Tomcat 6, but it works in Tomcat 7.

SEVERE: Servlet.service() for servlet jsp threw exception java.lang.NullPointerException
    at org.apache.jsp.page_jsp._jspInit(page_jsp.java:23)
    at org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:52)
    at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:159)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
    at com.dotvocal.poa.vocal.main.servlet.LoadCompany.execute(MyServlet.java:100)
    at com.dotvocal.poa.vocal.main.servlet.LoadCompany.doGet(MyServlet.java:60)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Unknown Source)

I also tried the following:

request.getRequestDispatcher("http://localhost:8080/myapp/page.jsp").forward(request,response);

But it didn’t solve the problem.

  • 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-10T16:50:29+00:00Added an answer on June 10, 2026 at 4:50 pm

    java.lang.NullPointerException at org.apache.jsp.page_jsp._jspInit(page_jsp.java:23)

    You have servletcontainer-specific JSP libraries such as jsp-api.jar in your webapp’s /WEB-INF/lib or maybe JDK/lib or JDK/lib/ext.

    Remove them. They don’t belong there at all. The servletcontainer itself already ships with those libraries. Based on the problem symptoms, the one which you’ve in your webapp originated from Tomcat 7 and thus your webapp will fail to work when you deploy it to a different servletcontainer make/version such as Tomcat 6, because it would conflict with servletcontainer’s own libraries.

    Erroneously placing servletcontainer-specific libraries in webapp’s /WEB-INF/lib is a classic starter’s mistake in a wrong attempt to fix Servlet API compilation errors in the IDE project. You should instead reference the servletcontainer as "target runtime" in the IDE project.

    See also:

    • How do I import the javax.servlet API in my Eclipse project?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { .... .... getServletContext().getRequestDispatcher(/output.jsp).forward(request, response);
I need to forward my request (to a jsp but I don't think it's
I'm trying to forward a servlet response to the same page from when it
From a servlet, I'm forwarding the request to a JSP page which renders a
When I run the following servlet: // package projectcodes; public void doPost(HttpServletRequest request,HttpServletResponse response)
I am trying to dispatch in a servlet request handler to the JSP processor
I want to send a request to another server from my servlet and get
If I have a servlet I am able to forward to a jsp in
I want to redirect JSP page from one servlet. All JSP pages are under
This is my jsp code: <%@ page language=java %> <% String name = (String)request.getAttribute(name1);

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.