title: JSP Page Won't Work: java.lang.ClassNotFoundException: org.apache.jsp and The value for the useBean class attribute is invalid
body: <p>I am having an issue running a jsp file which uses a java class. The jsp file is called temp.jsp. I have put my jsp file in the ROOT folder on a tomcat server
  The class is found in ROOT/WEB-INF/classes/com/java/tempBean.class</p>
  
  <p><strong>Here is the all the code from my temp.jsp file:</strong></p>
  
  <pre><code>&lt;jsp:useBean id="report" class="com.java.tempBean" scope="page"&gt;
  &lt;/jsp:useBean&gt;
  </code></pre>
  
  <p><strong>Here is all the code from my tempBean.class file (the class is empty - im just trying to produce no errors at the moment!)</strong></p>
  
  <pre><code>package com.java;
  
  
  public class tempBean
  {
  
      public tempBean()
      {
      }
  }
  </code></pre>
  
  <p>When I try to open the jsp page I get the following errors (between refreshes I get either the first or second error)</p>
  
  <pre><code>org.apache.jasper.JasperException: /temp.jsp (line: 1, column: 1) The value for the useBean class attribute com.java.tempBean is invalid.
  
  
      org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:41)
          org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
          org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)
          org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1229)
          org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1182)
          org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
          org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428)
          org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2434)
          org.apache.jasper.compiler.Node$Root.accept(Node.java:475)
          org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
          org.apache.jasper.compiler.Generator.generate(Generator.java:3485)
          org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:249)
          org.apache.jasper.compiler.Compiler.compile(Compiler.java:372)
          org.apache.jasper.compiler.Compiler.compile(Compiler.java:352)
          org.apache.jasper.compiler.Compiler.compile(Compiler.java:339)
          org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:601)
          org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:344)
          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)
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>exception
  
  org.apache.jasper.JasperException: java.lang.ClassNotFoundException: org.apache.jsp.temp_jsp
      org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:168)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:356)
      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.temp_jsp
      java.net.URLClassLoader$1.run(URLClassLoader.java:200)
      java.security.AccessController.doPrivileged(Native Method)
      java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      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:162)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:356)
      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)
  </code></pre>
  
  <p>Any help is really appreciated :) thanks!</p>