title: HTTP Status 500 - org.apache.jasper.JasperException: java.lang.ClassNotFoundException: org.apache.jsp.register_jsp
body: <p>I am having problem displaying register.jsp webpage from Tomcat Server.  The register.jsp is located in WEB-INF/jsp and also at webapps/register folder and RegisterController.class is located at WEB-INF/classes. I have register.jsp in two places because I am trying to make register.jsp work but eventually register.jsp will reside in WEB-INF/jsp. The problems seems to be in either web.xml or register-servlet.xml.  I am using Tomcat 7.0.21, Spring MVC 3.0.  </p>
  
  <p>The web.xml file</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;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_2_5.xsd" 
           id="WebApp_ID" version="2.5"&gt;      
  
    &lt;display-name&gt;Snap Fires&lt;/display-name&gt;
    &lt;servlet&gt;
          &lt;servlet-name&gt;register&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
  
      &lt;listener&gt;
        &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
      &lt;/listener&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;register&lt;/servlet-name&gt;
          &lt;url-pattern&gt;*.htm&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
  
  
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p>The register-servlet.xml file</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:p="http://www.springframework.org/schema/p"
  
      xsi:schemaLocation="http://www.springframework.org/schema/beans
                          http://www.springframework.org/schema/beans/spring-beans.xsd"&gt;
  
      &lt;bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
  
          &lt;property name="prefix"&gt;
             &lt;value&gt; /WEB-INF/jsp/&lt;/value&gt;
          &lt;/property&gt;
          &lt;property name="suffix"&gt;
            &lt;value&gt;.jsp&lt;/value&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean name="/register.jsp" class="snapFires.controller.RegisterController"/&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>The Error Code: </p>
  
  <pre><code>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: java.lang.ClassNotFoundException: org.apache.jsp.register_jsp
      org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:178)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:370)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
  
  root cause
  
  java.lang.ClassNotFoundException: org.apache.jsp.register_jsp
      java.net.URLClassLoader$1.run(URLClassLoader.java:366)
      java.net.URLClassLoader$1.run(URLClassLoader.java:355)
      java.security.AccessController.doPrivileged(Native Method)
      java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:132)
      org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:63)
      org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:172)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:370)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
  
  note The full stack trace of the root cause is available in the Apache Tomcat/7.0.21 logs.
  Apache Tomcat/7.0.21
  </code></pre>
  
  <p>register.jsp file</p>
  
  <pre><code>&lt;%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %&gt;
  &lt;%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %&gt;
  &lt;%@ page language="java" contentType="text/html; charset=UTF-8"
      pageEncoding="UTF-8"%&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
  &lt;title&gt;Registration Page&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;h1&gt;Create New Person&lt;/h1&gt;
  
  
  &lt;form:form action="/jsp/registerOut.html" commandName="register"&gt;
   &lt;table&gt;
    &lt;tr&gt;
     &lt;td&gt;&lt;form:label path="firstName"&gt;First Name:&lt;/form:label&gt;&lt;/td&gt;
     &lt;td&gt;&lt;form:input path="firstName"/&gt;&lt;/td&gt;
    &lt;/tr&gt;
  
    &lt;tr&gt;
     &lt;td&gt;&lt;form:label path="lastName"&gt;Last Name&lt;/form:label&gt;&lt;/td&gt;
     &lt;td&gt;&lt;form:input path="lastName"/&gt;&lt;/td&gt;
    &lt;/tr&gt;
   &lt;/table&gt;
  
   &lt;input type="submit" value="Save" /&gt;
  &lt;/form:form&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>RegisterController.java Class</p>
  
  <pre><code>package snapFires.controller;
  
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  import javax.servlet.ServletException;
  //import javax.annotation.Resource;
  
  import org.apache.log4j.Logger;
  //import org.springframework.ui.ModelMap;
  import org.springframework.ui.Model;
  import org.springframework.web.servlet.ModelAndView;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RequestMethod;
  import org.springframework.web.bind.annotation.ModelAttribute;
  //import org.springframework.web.bind.annotation.RequestMapping;
  //import org.springframework.web.servlet.ModelAndView;
  import org.springframework.web.servlet.mvc.multiaction.MultiActionController;
  //import org.springframework.web.servlet.mvc.SimpleFormController;
  import java.io.IOException;
  //import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.stereotype.Controller;
  
  import snapFires.domain.Name;
  import snapFires.service.RegisterImpl;
  
  @Controller
  @RequestMapping("/register")
  public class RegisterController extends MultiActionController {
  
  
      public ModelAndView handleRequest (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
          return new ModelAndView("register.jsp");
      }
      //@Resource(name="register")
      //private RegisterImpl registerImpl;
      protected static Logger logger = Logger.getLogger("controller");
  
      @RequestMapping(value="/jsp/register.html", method=RequestMethod.GET)
      public void simpleForm(Model model){
          model.addAttribute(new RegisterImpl());
      }
  
      @RequestMapping(value="/jsp/registerOut.html", method=RequestMethod.POST)
      public void simple(@ModelAttribute RegisterImpl registerImpl, Model model){
          model.addAttribute("register", registerImpl);
      }
  
  
  
  }
  </code></pre>