title: Jasper Report giving java.lang.ExceptionInInitializerError
body: <p>I have made report using Jasper report ireport. and it is generating successfully on my laptop. but when i deploy same jar file to other computer then generating report then it will give the error :</p>
  
  <pre><code>Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
   at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXMLoader.java:248)
  </code></pre>
  
  <p>i have put the all the jar file related to jasper at the same location where it place on my laptop. but it gives same error.</p>
  
  <p>The code :</p>
  
  <pre><code>public class JasperReport {
      public void generateReport(int invoiceNumber, String fileName) {
          Connection connection = null;
          try {
              connection = ConnectDB.openConnection();
              net.sf.jasperreports.engine.JasperReport jasperReport;
              try (InputStream inputStream = this.getClass().getResourceAsStream("report1_1.jrxml")) {
                  System.out.println("Hello "+JasperReport.class.getResource("report1_1.jrxml").getFile().toString());
                  JasperDesign jasperDesign = JRXmlLoader.load(inputStream);
                  jasperReport = JasperCompileManager.compileReport(jasperDesign);
              }
             Map&lt;String, Object&gt; map = new HashMap&lt;String, Object&gt;();
             map.put("invoiceNumber", invoiceNumber);
             JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, map, connection);
  
             File fileReportName = new File(fileName);
             OutputStream outputStream = new FileOutputStream(fileReportName);
             JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
             outputStream.close();
          } catch (Exception ex) {
              System.out.println(ex.getMessage());
              Logger.getLogger(JasperReport.class.getName()).log(Level.SEVERE, null, ex);
          } finally {
                  ConnectDB.closeConnection();
              }
  
      }
  
          public static void generateStockReport(String fileName) {
          try {
              String userName = "root";
          String password = "pass";
          String url = "jdbc:mysql://127.0.0.1:3306/JindalEnterprises";
          Class.forName ("com.mysql.jdbc.Driver").newInstance ();
          Connection connection = (Connection) DriverManager.getConnection ( url, userName , password );
  
              String workingDir = System.getProperty("user.dir");
              workingDir=workingDir+"/src/com/jindal/reports/report1_1.jrxml";
            classPath=report.getClass().getResource("JasperReport.class").getPath();
              System.out.println(workingDir);
              InputStream inputStream = new FileInputStream(new File(workingDir));
              JasperDesign jasperDesign = JRXmlLoader.load(inputStream);
              net.sf.jasperreports.engine.JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
              inputStream.close();
             JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, null, connection);
  
             File fileReportName = new File(fileName);
             OutputStream outputStream = new FileOutputStream(fileReportName);
             JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
             outputStream.close();
          } catch (Exception ex) {
              Logger.getLogger(JasperReport.class.getName()).log(Level.SEVERE, null, ex);
          }
  
      }
  </code></pre>