public void afterPropertiesSet()

in jasperreports/src/main/java/org/apache/struts/example/jasperreports/service/JapserInitializer.java [21:37]


  public void afterPropertiesSet() throws Exception {
    try {
      LOG.info("=== Start JasperReport compile ===");
      JasperCompileManager.compileReportToFile(
          Optional.ofNullable(
                  JapserInitializer.class.getResource("/jasper/our_jasper_template.jrxml"))
              .orElseThrow(
                  () -> {
                    throw new IllegalStateException("our_jasper_template.jrxml File not found.");
                  })
              .getFile(),
          sc.getRealPath(COMPILED_JASPER_FILE));
      LOG.info("=== End JasperReport compile ===");
    } catch (Exception e) {
      throw new IllegalStateException("Failed to compile, " + e.getMessage(), e);
    }
  }