与Linux Debian在NAS上宣传应用程序时,错误编辑票证



我在nas(linux debian)上使用mysql java play!框架摩擦了一个应用程序(linux debian),但是当我想创建一张打印票时,我有这个错误:<<<<<</p>

net.sf.jasperreports.engine.jrexception:java.io.filenotfoundexception:app fr boutique boutique web web reparation reparationreport.jrxml(无文件或目录)

(在使用Windows本地安装应用程序时,所有功能都很好)

文件Generator.java的一部分:

public static InputStream generateReparation(long id) {
    // - Paramètres de connexion à la base de données
    String url = "jdbc:mysql://127.0.0.1:3306/bddbc";
    String login = "root";
    String password = "root";
    Connection connection = null;
    try {
        OutputStream os = new ByteArrayOutputStream();
        // - Connexion à la base
        Driver monDriver = new com.mysql.jdbc.Driver();
        DriverManager.registerDriver(monDriver);
        connection = DriverManager.getConnection(url, login, password);
        // - Chargement et compilation du rapport
       JasperDesign jasperDesign = JRXmlLoader.load("app\fr\boutique\web\reports\reparationReport.jrxml");
        JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
        // - Paramètres à envoyer au rapport
        Map parameters = new HashMap();
        parameters.put("CURRENT_PATH", "app\fr\boutique\web\reports");
        parameters.put("idReparation", id);
        System.out.println("Id = " + id);
        // - Execution du rapport
        JasperPrint jrprint = JasperFillManager.fillReport(jasperReport, parameters, connection);
        // - Création du rapport au format PDF
        JasperExportManager.exportReportToPdfStream(jrprint, os);
        return new ByteArrayInputStream(((ByteArrayOutputStream) os).toByteArray());
    } catch (JRException e) {
        e.printStackTrace();
    } catch (SQLException e) {
        e.printStackTrace();
    } finally {
        try {
             connection.close();
            } catch (SQLException e) {
                    e.printStackTrace();
            }
    }
    return null;
}

您正在使用路径中的错误目录分离器。Linux使用前向斜线(/)来定界目录,而不是后斜线()。

最新更新