简体   繁体   English

关于玻璃鱼的报告失败

[英]Report fails on glassfish

I've made a report using iReport 5.1.0 and deployed on Tomcat server and it works just fine. 我已经使用iReport 5.1.0作了一份报告,并将其部署在Tomcat服务器上,并且工作正常。 But when is deployed in production server (Glassfish 3.1), the report never shows up. 但是,当部署在生产服务器(Glassfish 3.1)中时,该报告将永远不会显示。 The glassfish log is empty, so no error was found. glassfish日志为空,因此未发现任何错误。

When i run in eclipse (debug mode at Glassfish), the execution seems to jump in 当我在Eclipse(Glassfish的调试模式)下运行时,执行似乎跳入了

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

line. 线。

Next to this message is the code i've been using, and working, in Tomcat. 该消息旁边是我一直在Tomcat中使用和工作的代码。

PD Forgive my english i'm a native spanish speaker. PD原谅我的英语,我是说西班牙语的人。

The code: 编码:

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;
    }

Verify that you have all jasper libraries on your production server : they should be under glassfish/domains/domain1/lib/ext. 验证生产服务器上是否具有所有jasper库:它们应位于glassfish / domains / domain1 / lib / ext下。 If the jars are not there (or some of them - like the fonts or some other not mandatory lib), you might experience the behavior you are describing. 如果罐子不存在(或其中的一些罐子-如字体或其他一些非必需的lib),您可能会遇到所描述的行为。 Also make sure that the database on the production machine is not empty. 还要确保生产机器上的数据库不为空。 If there is no data to display, jasper shows an empty page. 如果没有要显示的数据,jasper将显示一个空白页。

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

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