繁体   English   中英

关于玻璃鱼的报告失败

[英]Report fails on glassfish

我已经使用iReport 5.1.0作了一份报告,并将其部署在Tomcat服务器上,并且工作正常。 但是,当部署在生产服务器(Glassfish 3.1)中时,该报告将永远不会显示。 glassfish日志为空,因此未发现任何错误。

当我在Eclipse(Glassfish的调试模式)下运行时,执行似乎跳入了

JasperViewer jasperViewer = new JasperViewer(re, false, null);

线。

该消息旁边是我一直在Tomcat中使用和工作的代码。

PD原谅我的英语,我是说西班牙语的人。

编码:

public boolean mostrarReporte(String template, Map parametros) {
        JasperReport report = null;
        JasperPrint re = null;
        Connection conn = conexion();
        boolean success = true;

        try {
            String in = FacesUtils.getExternalContext().getRealPath(
                    "/reportTemplates/" + template);
            report = (JasperReport) JRLoader.loadObject(in);

            re = JasperFillManager.fillReport(report, parametros, conn);
            JasperViewer jasperViewer = new JasperViewer(re, false, null);
            // Mostrar el reporte
            jasperViewer.setVisible(true);
            jasperViewer.setDefaultCloseOperation(0);
            parametros.clear();

        } catch (JRException e) {
            success = false;
            e.printStackTrace();
        } finally {
            try {
                conn.close();
            } catch (Exception e) {
            }
        }
        return success;
    }

验证生产服务器上是否具有所有jasper库:它们应位于glassfish / domains / domain1 / lib / ext下。 如果罐子不存在(或其中的一些罐子-如字体或其他一些非必需的lib),您可能会遇到所描述的行为。 还要确保生产机器上的数据库不为空。 如果没有要显示的数据,jasper将显示一个空白页。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM