title: Unable to compile class for JSP: HTTP Status 500
body: <p>my project has tomcat 8, JDK7 and my server has tomcat 7.</p>
  
  <p>After logging in to the admin page, I encountered the following error. But on my laptop it run good.</p>
  
  <p>org.apache.jasper.JasperException: Unable to compile class for JSP: </p>
  
  <pre><code>An error occurred at line: [15] in the generated java file: [/usr/local/easy/share/easy-tomcat7/work/Catalina/homecab.net/admin/org/apache/jsp/manager_005fcategory_jsp.java]
  Only a type can be imported. model.Category resolves to a package
  
  An error occurred at line: [18] in the generated java file: [/usr/local/easy/share/easy-tomcat7/work/Catalina/homecab.net/admin/org/apache/jsp/manager_005fcategory_jsp.java]
  Only a type can be imported. dao.CategoryDAO resolves to a package
  
  An error occurred at line: 23 in the jsp file: /manager_category.jsp
  CategoryDAO cannot be resolved to a type
  20:     &lt;/head&gt;
  21:     &lt;body&gt;
  22:         &lt;%
  23:             CategoryDAO categoryDAO = new CategoryDAO();
  24:         %&gt;
  25: 
  26:         &lt;jsp:include page="header.jsp"&gt;&lt;/jsp:include&gt;
  
  An error occurred at line: 23 in the jsp file: /manager_category.jsp
  CategoryDAO cannot be resolved to a type
  20:     &lt;/head&gt;
  21:     &lt;body&gt;
  22:         &lt;%
  23:             CategoryDAO categoryDAO = new CategoryDAO();
  24:         %&gt;
  25: 
  26:         &lt;jsp:include page="header.jsp"&gt;&lt;/jsp:include&gt;
  
  
  An error occurred at line: 46 in the jsp file: /manager_category.jsp
  Category cannot be resolved to a type
  43: 
  44:                     &lt;%
  45:                         int count = 0;
  46:                         for (Category category : categoryDAO.getListCategory()) {
  47:                             count++;
  48:                     %&gt;
  49:                     &lt;tr class="data"&gt;
  
  Stacktrace:
      org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
      org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:366)
      org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:463)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:378)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
      org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
      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)
  </code></pre>
  
  <p>and there is manager_category.jsp</p>
  
  <pre><code> &lt;%@page import="java.util.ArrayList"%&gt;
  &lt;%@page contentType="text/html" pageEncoding="UTF-8"%&gt;
  &lt;%@page import="model.Category, java.util.*, java.io.*" %&gt;
  &lt;%@page import="dao.CategoryDAO, java.util.*, java.io.*" %&gt;
  &lt;!DOCTYPE html&gt;
  
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
          &lt;title&gt;manager category&lt;/title&gt;
  
          &lt;link href="../css/mos-style.css" rel="stylesheet" type="text/css" media="all" /&gt; 
  
      &lt;/head&gt;
      &lt;body&gt;
          &lt;%
              CategoryDAO categoryDAO = new CategoryDAO();
          %&gt;
  
      &lt;jsp:include page="header.jsp"&gt;&lt;/jsp:include&gt;
  
          &lt;div id="wrapper"&gt;
  
          &lt;jsp:include page="menu.jsp"&gt;&lt;/jsp:include&gt;
              &lt;div id="rightContent"&gt;
                  &lt;h3&gt;Quản lý thể loại&lt;/h3&gt;
  
                  &lt;a href="../admin/insert_category.jsp"&gt;Thêm thể loại&lt;/a&gt;
  
                  &lt;table id="datatable-buttons"  class="data table-striped"  &gt;
                      &lt;tr class="data"&gt;
                          &lt;th class="data" width="30px"&gt;STT&lt;/th&gt;
                          &lt;th class="data"&gt;Mã Thể Loại&lt;/th&gt;
                          &lt;th class="data"&gt;Tên Thể Loại&lt;/th&gt;
                          &lt;th class="data" width="90px"&gt;Tùy Chọn&lt;/th&gt;
                      &lt;/tr&gt;
  
                  &lt;%
                      int count = 0;
                      for (Category category : categoryDAO.getListCategory()) {
                          count++;
                  %&gt;
                  &lt;tr class="data"&gt;
                      &lt;td class="data" width="30px"&gt;&lt;%=count%&gt;&lt;/td&gt;
                      &lt;td class="data"&gt;&lt;%=category.getCategoryID()%&gt;&lt;/td&gt;
                      &lt;td class="data"&gt;&lt;%=category.getCategoryName()%&gt;&lt;/td&gt;
                      &lt;td class="data" width="90px"&gt;
                  &lt;center&gt;
                      &lt;a href="../admin/update_category.jsp?command=updateCategory&amp;category_id=&lt;%=category.getCategoryID()%&gt;"&gt;Sửa&lt;/a&gt;&amp;nbsp;&amp;nbsp; | &amp;nbsp;&amp;nbsp;
                      &lt;a href="/shop/ManagerCategoryServlet?command=deleteCategory&amp;category_id=&lt;%=category.getCategoryID()%&gt;"&gt;Xóa&lt;/a&gt;
                  &lt;/center&gt;
                  &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;%}%&gt;
              &lt;/table&gt;
          &lt;/div&gt;
          &lt;div class="clear"&gt;&lt;/div&gt;
  
          &lt;jsp:include page="footer.jsp"&gt;&lt;/jsp:include&gt;
  
      &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p></p>
  
  <p>Please tell me what happend! i was import </p>
  
  <pre><code>&lt;%@page import="model.Category, java.util., java.io." %&gt; &lt;%@page import="dao.CategoryDAO, java.util., java.io." %&gt;
  </code></pre>
  
  <p>i will search some same question on stack, but i cant resolve it. Please help me, thanks for all.</p>