将jasper报告与java servlet结合使用时出错

时间:2011-08-29 08:44:27

标签: java jasper-reports

我正在使用dwr.i中的jasperReports生成报告,我发现了这些错误

INFO: Errors were encountered when compiling report expressions class file:
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:4: package net.sf.jasperreports.engine does not exist
import net.sf.jasperreports.engine.*;
^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:5: package net.sf.jasperreports.engine.fill does not exist
import net.sf.jasperreports.engine.fill.*;
^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:13: package net.sf.jasperreports.engine does not exist
import net.sf.jasperreports.engine.*;
^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:15: package net.sf.jasperreports.engine.data does not exist
import net.sf.jasperreports.engine.data.*;
^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:21: cannot find symbol
symbol: class JREvaluator
public class classic_1314606689888_793831 extends JREvaluator
                                                  ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:28: cannot find symbol
symbol  : class JRFillParameter
location: class classic_1314606689888_793831
    private JRFillParameter parameter_REPORT_LOCALE = null;
            ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:29: cannot find symbol
symbol  : class JRFillParameter
location: class classic_1314606689888_793831
    private JRFillParameter parameter_JASPER_REPORT = null;
            ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:30: cannot find symbol
symbol  : class JRFillParameter
location: class classic_1314606689888_793831
    private JRFillParameter parameter_REPORT_VIRTUALIZER = null;
            ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:31: cannot find symbol
symbol  : class JRFillParameter
location: class classic_1314606689888_793831
    private JRFillParameter parameter_REPORT_TIME_ZONE = null;
            ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:32: cannot find symbol
symbol  : class JRFillParameter
location: class classic_1314606689888_793831
    private JRFillParameter parameter_SORT_FIELDS = null;
            ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:33: cannot find symbol
symbol  : class JRFillParameter
location: class classic_1314606689888_793831
    private JRFillParameter parameter_REPORT_FILE_RESOLVER = null;
            ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:34: cannot find symbol
symbol  : class JRFillParameter
location: class classic_1314606689888_793831
    private JRFillParameter parameter_REPORT_SCRIPTLET = null;
            ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:35: cannot find symbol
symbol  : class JRFillParameter
location: class classic_1314606689888_793831
    private JRFillParameter parameter_REPORT_PARAMETERS_MAP = null;
            ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:36: cannot find symbol
symbol  : class JRFillParameter
location: class classic_1314606689888_793831
    private JRFillParameter parameter_REPORT_CONNECTION = null;
            ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:37: cannot find symbol
symbol  : class JRFillParameter
location: class classic_1314606689888_793831
    private JRFillParameter parameter_REPORT_CLASS_LOADER = null;
            ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:38: cannot find symbol
symbol  : class JRFillParameter
location: class classic_1314606689888_793831
    private JRFillParameter parameter_REPORT_DATA_SOURCE = null;
            ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:39: cannot find symbol
symbol  : class JRFillParameter
location: class classic_1314606689888_793831
    private JRFillParameter parameter_REPORT_URL_HANDLER_FACTORY = null;
            ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:40: cannot find symbol
symbol  : class JRFillParameter
location: class classic_1314606689888_793831
    private JRFillParameter parameter_IS_IGNORE_PAGINATION = null;
            ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:41: cannot find symbol
symbol  : class JRFillParameter
location: class classic_1314606689888_793831
    private JRFillParameter parameter_REPORT_FORMAT_FACTORY = null;
            ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:42: cannot find symbol
symbol  : class JRFillParameter
location: class classic_1314606689888_793831
    private JRFillParameter parameter_REPORT_MAX_COUNT = null;
            ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:43: cannot find symbol
symbol  : class JRFillParameter
location: class classic_1314606689888_793831
    private JRFillParameter parameter_REPORT_TEMPLATES = null;
            ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:44: cannot find symbol
symbol  : class JRFillParameter
location: class classic_1314606689888_793831
    private JRFillParameter parameter_REPORT_RESOURCE_BUNDLE = null;
            ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:45: cannot find symbol
symbol  : class JRFillField
location: class classic_1314606689888_793831
    private JRFillField field_sach_MaSach = null;
            ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:46: cannot find symbol
symbol  : class JRFillField
location: class classic_1314606689888_793831
    private JRFillField field_sach_TenSach = null;
            ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:47: cannot find symbol
symbol  : class JRFillField
location: class classic_1314606689888_793831
    private JRFillField field_sach_MaNhaXuatBan = null;
            ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:48: cannot find symbol
symbol  : class JRFillField
location: class classic_1314606689888_793831
    private JRFillField field_sach_GiaBan = null;
            ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:49: cannot find symbol
symbol  : class JRFillField
location: class classic_1314606689888_793831
    private JRFillField field_sach_SoLuongTon = null;
            ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:50: cannot find symbol
symbol  : class JRFillField
location: class classic_1314606689888_793831
    private JRFillField field_sach_MaTheLoai = null;
            ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:51: cannot find symbol
symbol  : class JRFillVariable
location: class classic_1314606689888_793831
    private JRFillVariable variable_PAGE_NUMBER = null;
            ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:52: cannot find symbol
symbol  : class JRFillVariable
location: class classic_1314606689888_793831
    private JRFillVariable variable_COLUMN_NUMBER = null;
            ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:53: cannot find symbol
symbol  : class JRFillVariable
location: class classic_1314606689888_793831
    private JRFillVariable variable_REPORT_COUNT = null;
            ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_13146
INFO: 06689888_793831.java:54: cannot find symbol
symbol  : class JRFillVariable
location: class classic_1314606689888_793831
    private JRFillVariable variable_PAGE_COUNT = null;
            ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:55: cannot find symbol
symbol  : class JRFillVariable
location: class classic_1314606689888_793831
    private JRFillVariable variable_COLUMN_COUNT = null;
            ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:78: cannot find symbol
symbol  : class JRFillParameter
location: class classic_1314606689888_793831
        parameter_REPORT_LOCALE = (JRFillParameter)pm.get("REPORT_LOCALE");
                                   ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:79: cannot find symbol
symbol  : class JRFillParameter
location: class classic_1314606689888_793831
        parameter_JASPER_REPORT = (JRFillParameter)pm.get("JASPER_REPORT");
                                   ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:80: cannot find symbol
symbol  : class JRFillParameter
location: class classic_1314606689888_793831
        parameter_REPORT_VIRTUALIZER = (JRFillParameter)pm.get("REPORT_VIRTUALIZER");
                                        ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:81: cannot find symbol
symbol  : class JRFillParameter
location: class classic_1314606689888_793831
        parameter_REPORT_TIME_ZONE = (JRFillParameter)pm.get("REPORT_TIME_ZONE");
                                      ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:82: cannot find symbol
symbol  : class JRFillParameter
location: class classic_1314606689888_793831
        parameter_SORT_FIELDS = (JRFillParameter)pm.get("SORT_FIELDS");
                                 ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:83: cannot find symbol
symbol  : class JRFillParameter
location: class classic_1314606689888_793831
        parameter_REPORT_FILE_RESOLVER = (JRFillParameter)pm.get("REPORT_FILE_RESOLVER");
                                          ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:84: cannot find symbol
symbol  : class JRFillParameter
location: class classic_1314606689888_793831
        parameter_REPORT_SCRIPTLET = (JRFillParameter)pm.get("REPORT_SCRIPTLET");
                                      ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:85: cannot find symbol
symbol  : class JRFillParameter
location: class classic_1314606689888_793831
        parameter_REPORT_PARAMETERS_MAP = (JRFillParameter)pm.get("REPORT_PARAMETERS_MAP");
                                           ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:86: cannot find symbol
symbol  : class JRFillParameter
location: class classic_1314606689888_793831
        parameter_REPORT_CONNECTION = (JRFillParameter)pm.get("REPORT_CONNECTION");
                                       ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:87: cannot find symbol
symbol  : class JRFillParameter
location: class classic_1314606689888_793831
        parameter_REPORT_CLASS_LOADER = (JRFillParameter)pm.get("REPORT_CLASS_LOADER");
                                         ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:88: cannot find symbol
symbol  : class JRFillParameter
location: class classic_1314606689888_793831
        parameter_REPORT_DATA_SOURCE = (JRFillParameter)pm.get("REPORT_DATA_SOURCE");
                                        ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:89: cannot find symbol
symbol  : class JRFillParameter
location: class classic_1314606689888_793831
        parameter_REPORT_URL_HANDLER_FACTORY = (JRFillParameter)pm.get("REPORT_URL_HANDLER_FACTORY");
                                                ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:90: cannot find symbol
symbol  : class JRFillParameter
location: class classic_1314606689888_793831
        parameter_IS_IGNORE_PAGINATION = (JRFillParameter)pm.get("IS_IGNORE_PAGINATION");
                                          ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:91: cannot find symbol
symbol  : class JRFillParameter
location: class classic_1314606689888_793831
        parameter_REPORT_FORMAT_FACTORY = (JRFillParameter)pm.get("REPORT_FORMAT_FACTORY");
                                           ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:92: cannot find symbol
symbol  : class JRFillParameter
location: class classic_1314606689888_793831
        parameter_REPORT_MAX_COUNT = (JRFillParameter)pm.get("REPORT_MAX_COUNT");
                                      ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:93: cannot find symbol
symbol  : class JRFillParameter
location: class classic_1314606689888_793831
        parameter_REPORT_TEMPLATES = (JRFillParameter)pm.get("REPORT_TEMPLATES");
                                      ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:94: cannot find symbol
symbol  : class JRFillParameter
location: class classic_1314606689888_793831
        parameter_REPORT_RESOURCE_BUNDLE = (JRFillParameter)pm.get("REPORT_RESOURCE_BUNDLE");
                                            ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:103: cannot find symbol
symbol  : class JRFillField
location: class classic_1314606689888_793831
        field_sach_MaSach = (JRFillField)fm.get("sach_MaSach");
                             ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:104: cannot find symbol
symbol  : class JRFillField
location: class classic_1314606689888_793831
        field_sach_TenSach = (JRFillField)fm.get("sach_TenSach");
                              ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:105: cannot find symbol
symbol  : class JRFillField
location: class classic_1314606689888_793831
        field_sach_MaNhaXuatBan = (JRFillField)fm.get("sach_MaNhaXuatBan");
                                   ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:106: cannot find symbol
symbol  : class JRFillField
location: class classic_1314606689888_793831
        field_sach_GiaBan = (JRFillField)fm.get("sach_GiaBan");
                             ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:107: cannot find symbol
symbol  : class JRFillField
location: class classic_1314606689888_793831
        field_sach_SoLuongTon = (JRFillField)fm.get("sach_SoLuongTon");
                                 ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:108: cannot find symbol
symbol  : class JRFillField
location: class classic_1314606689888_793831
        field_sach_MaTheLoai = (JRFillField)fm.get("sach_MaTheLoai");
                                ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:117: cannot find symbol
symbol  : class JRFillVariable
location: class classic_1314606689888_793831
        variable_PAGE_NUMBER = (JRFillVariable)vm.get("PAGE_NUMBER");
                                ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:118: cannot find symbol
symbol  : class JRFillVariable
location: class
INFO:  classic_1314606689888_793831
        variable_COLUMN_NUMBER = (JRFillVariable)vm.get("COLUMN_NUMBER");
                                  ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:119: cannot find symbol
symbol  : class JRFillVariable
location: class classic_1314606689888_793831
        variable_REPORT_COUNT = (JRFillVariable)vm.get("REPORT_COUNT");
                                 ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:120: cannot find symbol
symbol  : class JRFillVariable
location: class classic_1314606689888_793831
        variable_PAGE_COUNT = (JRFillVariable)vm.get("PAGE_COUNT");
                               ^
C:\Program Files\glassfish-3.1\glassfish\domains\domain1\classic_1314606689888_793831.java:121: cannot find symbol
symbol  : class JRFillVariable
location: class classic_1314606689888_793831
        variable_COLUMN_COUNT = (JRFillVariable)vm.get("COLUMN_COUNT");
                                 ^
61 errors

请帮我这方面生成报告

3 个答案:

答案 0 :(得分:1)

尝试添加jasperreports * .jar以及包含在glassfish3 / glassfish / domains / domain1 / lib / ext下的报告中引用的类的任何其他jar。 重启应用服务器。

此致

答案 1 :(得分:0)

似乎缺少JasperReport库。最新版本的JasperReports可以在这里下载http://sourceforge.net/projects/jasperreports/files/jasperreports/JasperReports%204.5.0/

将jar文件添加到项目中并重新部署。

确保您还具有所需的依赖关系:http://www.installationwiki.org/JasperReports

答案 2 :(得分:0)

您需要在应用程序的类路径中添加JDT库。 (WEB-INF / IIb)的

jdtcore and jdt-compiler

在撰写本文时,3.1.0和3.1.1版本将分别适用于jasperreports 4.7.0。

此错误仅在我现在的glassfish中发生。在tomcat中,这个问题不会发生。

Jasper FAQ: When should I compile my report templates and how?