title: HTTP Status 500 - An exception occurred processing JSP page /login.jsp at line 6. (error message title)
body: <p>I really need some one to  rescue me. I'm so grateful for last time, I posted a problem. Unfortunately the same problem / similar problem still pops up for almost 2 months. I can't finish up my projects because of 'this driver problem'.  I installed a couple of J/Connectors but still received an HTTP error message. So I decided to use MySQL installer to install all components  and this time receive this error message below:</p>
  
  <pre><code>HTTP Status 500 - An exception occurred processing JSP page /login.jsp at line 6
  type Exception report
  
  message An exception occurred processing JSP page /login.jsp at line 6
  
  description The server encountered an internal error that prevented it from fulfilling this.
  
  exception 
  org.apache.jasper.JasperException: An exception occurred processing JSP page /login.jsp at line 6
  
  3: &lt;%
  4:  String userid = request.getParameter("uname");
  5:  String pwd = request.getParameter("pass");
  6:  Class.forName("com.mysql.jdbc.Driver");
  7:  Connection con = DriverManager.getConnection
  8:  ("jdbc:mysql://localhost:3306/REG",
  9:      "root", "$jademedia247");
  
  
  Stacktrace:
  org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:455)
  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
  
  
  
  root cause 
  javax.servlet.ServletException: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
  org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:912)
  org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:841)
  org.apache.jsp.login_jsp._jspService(login_jsp.java:93)
  org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
  
  
  
  root cause 
  java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
  org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1702)
  org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)
  org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:126)
  org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:63)
  java.lang.Class.forName0(Native Method)
  java.lang.Class.forName(Class.java:169)
  org.apache.jsp.login_jsp._jspService(login_jsp.java:72)
  org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
  
  
  
  note The full stack trace of the root cause is available in the Apache Tomcat/7.0.50 logs.
  
  
  Apache Tomcat/7.0.50'
  </code></pre>
  
  <p><strong>CLASSPATH:C:\Program Files\MySQL\Connector J 5.1.28\mysql-connector-java-5.1.28-bin.jar;C:\Program Files\Apache Software Foundation\Tomcat 7.0\lib\jsp-api.jar;C:\Program Files\Java\jdk1.6.0_38\jre\lib</strong></p>
  
  <p>PATH:C:\Program Files\MySQL\MySQL Server 5.6\bin;C:\Program Files\Java\jdk1.6.0_38\bin;C:\Program Files\Apache Software Foundation\Tomcat 7.0\bin;C:\Program Files\MySQL\MySQL Utilities 1.3.6\</p>
  
  <p><strong>login.jsp</strong></p>
  
  <pre><code>&lt;%@ page import="java.io.*,java.util.*,java.sql.*" %&gt;
  &lt;%@ page import="javax.servlet.http.*,javax.servlet.*"%&gt;
  &lt;%
      String userid = request.getParameter("uname");
      String pwd = request.getParameter("pass");
      Class.forName("com.mysql.jdbc.Driver");
      Connection con = DriverManager.getConnection
      ("jdbc:mysql://localhost:3306/REG",
          "root", "$jademedia247");
      Statement st = con.createStatement();
      ResultSet rs;
      rs = st.executeQuery("select * from members where uname='" + userid + "' and pass='" + pwd + "'");
      if (rs.next()) {
      session.setAttribute("userid", userid);
      //out.println("Welcome" + userid);
      //out.println("&lt;a href='logout.jsp'&gt;Log out&lt;/a&gt;");
      response.sendRedirect("Success.jsp");
      } else {
          out.println("Invalid password &lt;a href='form.jsp'&gt; try again &lt;/a&gt;");
      }
      %&gt;
  </code></pre>
  
  <p><strong>registration.jsp</strong></p>
  
  <pre><code>&lt;%@page import ="java.sql.*"%&gt;
  &lt;%
  user = request.getParameter("uname");
  String pwd = request.getParameter("pass");
  String fname = request.getParameter("fname");
  String lname = request.getParameter("lname");
  String email = request.getParameter("email");
  Class.forName("com.mysql.jdbc.Driver");
  Connection con = DriverManager.getConnection
  ("jdbc:mysql://localhost:3306/REG","root", "$jademedia247");
  Statement st = con.createStatement();
  //ResultSet rs;
  int i = st.executeUpdate("insert into members (first_Name, last_Name, email, uname, pass,     regdate) values ('" + fname + "', '" + lname + "', '" + email + "','" + user + "', '" + pwd + "', CURDATE())"); 
      if (i &gt; 0) {
          //session.setAttribute("userid", user);
          response.sendRedirect("welcome.jsp");
          //out.print("Registration Successfull!"+"&lt;a href='form.jsp'&gt;Go to Login&lt;/a&gt;");
      } else {
          response.sendRedirect("form.jsp");
      }
      %&gt;
  </code></pre>
  
  <p><strong>File Path: C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\ROOT</strong></p>
  
  <pre><code>CREATE TABLE `members` (
    `id` int(10) unsigned NOT NULL auto_increment,
    `first_name` varchar(45) NOT NULL,
    `last_name` varchar(45) NOT NULL,
    `email` varchar(45) NOT NULL,
    `uname` varchar(45) NOT NULL,
    `pass` varchar(45) NOT NULL,
    `regdate` date NOT NULL,
    PRIMARY KEY  (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  </code></pre>
  
  <p><strong>Just created a database REG.</strong></p>