title: Cannot instantiate the type Iterator in JSP (Exception: The value for the useBean class attribute ... is invalid)
body: <p>this is my code, it seems right to me! i don't know why it keeps saying this:</p>
  
  <p>"Cannot instantiate the type Iterator"</p>
  
  <p>this is the servlet:</p>
  
  <pre><code>package uges.servlets;
  
  
  import jess.*;
  import java.io.*;
  import javax.servlet.*;
  import javax.servlet.http.*;
  import java.util.Iterator;
  
  public class Catalog extends BaseServlet {
  
  public void doGet(HttpServletRequest request,
                     HttpServletResponse response)
      throws IOException, ServletException {
      checkInitialized();
  
      try {
          String customerId =
              (String) request.getParameter("customerId");
          if (customerId == null || customerId.length() == 0) {
              dispatch(request, response, "/index.html");
              return;
          }
  
          request.getSession().invalidate();
          HttpSession session = request.getSession();
  
          session.setAttribute("customerId", customerId);
          session.setAttribute("orderNumber",
                               String.valueOf(getNewOrderNumber()));
  
          ServletContext servletContext = getServletContext();
          Rete engine = (Rete) servletContext.getAttribute("engine");
          Iterator result =
              engine.runQuery("all-products", new ValueVector());
          request.setAttribute("queryResult", result);
  
  
      } catch (JessException je) {
          throw new ServletException(je);
      }
  
      dispatch(request, response, "/catalog.jsp");
  }
  </code></pre>
  
  <p>this is the dispatch method, it 's in a servlet called BaseServlet:</p>
  
  <pre><code>protected void dispatch(HttpServletRequest request,
                          HttpServletResponse response,
                          String page)
      throws IOException, ServletException {
  
      ServletContext servletContext = getServletContext();
      RequestDispatcher dispatcher =
          servletContext.getRequestDispatcher(page);
      dispatcher.forward(request, response);
  }
  </code></pre>
  
  <p>and this the JSP code:</p>
  
  <pre><code>&lt;HTML&gt;
  &lt;%@ page import="jess.*" %&gt;
  &lt;jsp:useBean id="queryResult" class="java.util.Iterator" scope="request"/&gt;
  </code></pre>
  
  <p>the error is about the java.util.Iterator in the class type of useBean tag!</p>
  
  <p>the exception says : The value for the useBean class attribute java.util.Iterator is invalid</p>
  
  <p>any help please ..</p>
  
  <p>Thanks in advance!</p>