title: SearchServlet has been compiled by a more recent version of the Java Runtime
body: <p>When I use my search feature, I get an http status 500 error. It claims that </p>
  
  <blockquote>
    <p><strong>Error Report</strong></p>
    
    <p>HTTP Status 500 – Internal Server Error</p>
    
    <p>Type Exception Report</p>
    
    <p>Message SearchServlet has been compiled by a more recent version of
    the Java Runtime (class file version 53.0), this version of the Java
    Runtime only recognizes class file versions up to 52.0 (unable to load
    class [SearchServlet])</p>
    
    <p>Description The server encountered an unexpected condition that
    prevented it from fulfilling the request.</p>
    
    <p>Exception java.lang.UnsupportedClassVersionError: SearchServlet has
    been compiled by a more recent version of the Java Runtime (class file
    version 53.0), this version of the Java Runtime only recognizes class
    file versions up to 52.0 (unable to load class [SearchServlet])
      org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2286)
      org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:811)
      org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1260)
      org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
      org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:488)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
      org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
      org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
      org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
      org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)
      org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
      org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
      java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      java.lang.Thread.run(Unknown Source)</p>
  </blockquote>
  
  <p>I am using compiler compliance level 9.  I have JRE 1.8 which I thought was the most recent.  When I try to install Java 9, using the Eclipse Marketplace, it tells me that </p>
  
  <blockquote>
    <p>No repository found at
    <code>http://download.eclipse.org/eclipse/updates/none.</code></p>
  </blockquote>
  
  <p>I believe, given all of this, I am completely up to date, but how am I not able to search for records in the database?</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  
  &lt;head&gt;
    &lt;meta charset="ISO-8859-1" &lt;title&gt;Add contact to Phone Book&lt;/title&gt;
    &lt;h1&gt;Add contact to Phone Book&lt;/h1&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
    &lt;form name="submitInfo" method="get" action="AddEntryServlet" First Name: &lt;input type="text" name="firstName" /&gt;
    &lt;br/&gt;
    &lt;br/&gt;
     Last Name: &lt;input type="text" name="lastName" /&gt;
    &lt;br/&gt;
    &lt;br/&gt;
     Area Code: &lt;input type="number" name="areaCode" /&gt;
    &lt;br/&gt;
    &lt;br/&gt;
     Phone Number: &lt;input type="number" name="phoneNumber" /&gt;
    &lt;br/&gt;
    &lt;br/&gt;
    &lt;input type="submit" value="Submit" /&gt;
  
    &lt;/form&gt;
  &lt;/body&gt;
  &lt;h1&gt;Search for Contact in Phone Book&lt;/h1&gt;
  
  &lt;body&gt;
    &lt;form name="searchInfo" method="get" action="SearchServlet"&gt;
      Search First Name: &lt;input type="text" name="searchFirstName" /&gt;
      &lt;br/&gt;
      &lt;br/&gt;
  
      &lt;input type="submit" name="action" value="search" /&gt;
  
    &lt;/form&gt;
  &lt;/body&gt;
  
  &lt;/html&gt; 
  </code></pre>
  
  <p>Search servlet code</p>
  
  <pre><code>import java.io.IOException; 
  import java.io.PrintWriter; 
  import java.util.List;
  
  import javax.servlet.ServletException; 
  import javax.servlet.annotation.WebServlet;
  import javax.servlet.http.HttpServlet; 
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  
  import org.hibernate.Query; import org.hibernate.Session;
  
  import entities.Tbphonebook; import util.HibernateUtil;
  
  /**  * Servlet implementation class SearchServlet  */
  @SuppressWarnings("deprecation")
  @WebServlet("/SearchServlet")
  public class SearchServlet extends HttpServlet {    private static final long
  serialVersionUID = 1L;
  
  /**
  * @see HttpServlet#HttpServlet()
  */
  public SearchServlet() {
  super();
    // TODO Auto-generated constructor stub
    }
  
  /**      * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)      */
  @SuppressWarnings({ "deprecation","unchecked" })
      protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
      Session session = HibernateUtil.getSessionFactory().openSession();
      session.beginTransaction();
      String firstName = request.getParameter("searchFirstName");         
      @SuppressWarnings("rawtypes") 
      Query query = Session.createQuery("from Tbphonebook where firstname = ?");
  
  
  List&lt;Tbphonebook&gt; persons = (List&lt;Tbphonebook&gt;) query.getResultList();
  
  
  
  session.getTransaction().commit();      
  session.close();
  
  
  
  request.setAttribute("persons", persons);
  request.getRequestDispatcher("searchResults.jsp").forward(request,response);
  response.sendRedirect("searchResults.jsp");
  
  
  }
  </code></pre>
  
  <p>Results jsp</p>
  
  <pre><code>%@ page language="java" contentType="text/html; charset=ISO-8859-1"
  pageEncoding="ISO-8859-1"%&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=ISO-8859-1"&gt; &lt;title&gt;Insert title here&lt;/title&gt; &lt;/head&gt;
  &lt;h1&gt;Search Results&lt;/h1&gt;
  &lt;h1&gt;List Books:&lt;/h1&gt;
  &lt;table class="table table-boardered table-striped" id="searchresults"&gt;      
      &lt;tr&gt;            
          &lt;th&gt;First Name&lt;/th&gt;         
          &lt;th&gt;Last Name&lt;/th&gt;
          &lt;th&gt;Area Code&lt;/th&gt;          
          &lt;th&gt;PhoneNumber&lt;/th&gt;
      &lt;/tr&gt;       
  &lt;/table&gt;
  &lt;script&gt;
          $(document).ready(function(){
          $.getJSON("persons", function(data){
              var persons_data = '';
              $.each(data, function(key, value){
                  person_date += '&lt;tr&gt;';
                  person_data += '&lt;td&gt;'+value.Firstname+'&lt;/td&gt;';
                  person_data += '&lt;td&gt;'+value.Lastname+'&lt;/td&gt;';
                  person_data += '&lt;td&gt;'+value.Areacode+'&lt;/td&gt;';
                  person_data += '&lt;td&gt;'+value.Phonenumber+'&lt;/td&gt;';
                  person_date += '&lt;/tr&gt;';
              }
              );
          $('#searchresults').append(persons_data);
          });
      });
   &lt;/script&gt;
  &lt;%
      String message = (String) request.getAttribute("message");
      if(!(message == null)){
          out.println(message);
          }else{
              message= "";
              out.println(message);
          }
  %&gt;
  
   &lt;/html&gt;
  </code></pre>