org.apache.jasper.JasperException: Unable to compile class for JSPGenerated servlet error:
Only a type can be imported. com.test.QuartzTest resolves to a packageAn error occurred at line: 11 in the jsp file: /index.jsp
Generated servlet error:
QuartzTest cannot be resolved or is not a typeAn error occurred at line: 11 in the jsp file: /index.jsp
Generated servlet error:
QuartzTest cannot be resolved or is not a type

解决方案 »

  1.   

    line11  贴出来看下吧!

    不能编译 肯定写错了!
      

  2.   

    第11行就是这个com.test.QuartzTest类的一个实例化,导入也是自动导入的,但是这里为什么没把QuartzTest编译为一个类,而认为它是一个包?我这个project是从一个另外一个工作空间导入的,跟这个会有关系吗?
      

  3.   

    QuartzTest temp = new  QuartzTest();
    不要少了括号
      

  4.   

    楼上的兄弟。。如果这个错编译都不会通过的。
    我还是把页面贴出来吧,希望能有帮助
    index.jsp
    <%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><%@page import="com.test.QuartzTest"%><html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>ok</title>
    </head>
    <body>
    <%
    QuartzTest test = new QuartzTest();
    test.startSchedule();
    %>
    </body>
    </html>
      

  5.   

    楼上的兄弟。。如果这个错编译都不会通过的。
    我还是把页面贴出来吧,希望能有帮助
    index.jsp
    <%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><%@page import="com.test.QuartzTest"%><html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>ok</title>
    </head>
    <body>
    <%
    QuartzTest test = new QuartzTest();
    test.startSchedule();
    %>
    </body>
    </html>
      

  6.   

    把出错那个类的class文件连同目录结构复制到应用服务器的/classes下试试
      

  7.   

    QuartzTest cannot be resolved or is not a type
      

  8.   

    好像是tomcat的问题,以前遇到过
      

  9.   

    <%@page import="com.test.QuartzTest"%><html>
    放在
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    之前去试试
      

  10.   

    恩,貌似是,以前没有用过eclipse部署tomcat,不过这样是不是所有类都需要copy到tomcat的/classes下?有没有方便一点的方法呢,现在这个问题好像已经没了,又出个新问题
    java.lang.NoClassDefFoundError: org/quartz/Trigger
      

  11.   

    你Eclipse部署的tomcat是不是哪里配置出问题了
    重新配置一次吧
      

  12.   

    估计是配置有点小问题,或者是tomcat和eclipse版本问题
    你上面这个应该是少了jar包了
    quartz.jar包放到WEB-INF/lib下
      

  13.   

    ECLIPSE好久不用了,现在用myeclipse,越来越懒了,哈哈
      

  14.   

    哎,不行还是用myeclipse了,部署太麻烦了哈