title: JasperReports in Java Web Start Application
body: <p>I wrote a simple application to grab orders off of my server. I decided to be able to run some reports and display them in the <em>JasperViewer</em> and then from there decide if I want to print or export/save in a different format. It works fine when I run the project in <em>NetBeans</em> but once I compile it and publish it to my server, the report runs but I cannot get the report to open in the <em>JasperViewer</em>. In fact the viewer doesn't launch at all.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>try {
      Connection con = DriverManager.getConnection(
              "jdbc:mysql://MYDATABASE",
              "MY_UN",
              "MY_PW");
  
      java.sql.Statement stmt = con.createStatement();
  
      ResultSet rs = stmt.executeQuery("SELECT `Product_ID` AS PRODUCT_ID, `Name` AS PRODUCT_DESCRIPTION, `Qty` AS QTY, `Price` AS PRICE_EACH_LINE, `Line_Total` AS LINE_TOTAL_LINE FROM `orderlines`;");
  
      JRResultSetDataSource resultSetDataSource = new JRResultSetDataSource(rs);
  
      final Map&lt;String, Object&gt; parameter = new HashMap&lt;String, Object&gt;();
      parameter.put("DEALER_NAME", "TY JACOBS");
      parameter.put("DEALER_STREET", "MY_ADDRESS");
      parameter.put("DEALER_CITY_STATE_ZIP", "MY_CITY_STATE_ZIP");
      parameter.put("DEALER_PHONE", "MY_PHONE_NUMBER");
  
      ClassLoader classloader = getClass().getClassLoader();
      InputStream url = null;
      url = classloader.getResourceAsStream("OK/report3.jrxml");
      JasperReport jasperReport = JasperCompileManager.compileReport(url);
  
      JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameter, resultSetDataSource);
  
      JasperViewer.viewReport(jasperPrint, false);
  
  } catch (SQLException|JRException ex) {
      Logger.getLogger(DbReportDSFill.class.getName()).log(Level.SEVERE, null, ex);
  }
  </code></pre>
  
  <p>One more thing, I can run it locally also with no problems. It just seems to be once I publish it to the server that I cannot get the report in <em>JasperViewer</em>. </p>