title: JasperReports with XML as input --- Getiing Inputstream null pointer exception
body: <p>I am using iReport-4.1.1 to create the .jasper and .jrxml FILES. My files are under Webcontent/reports</p>
  
  <p>Below is the code that I am using to open a PDF from jasper. I am passing XML as the input.</p>
  
  <pre><code>InputStream reportStream = getServletConfig().getServletContext().getResourceAsStream("/reports/FUECReport.jasper");
  JRXmlDataSource xmlDataSource = new JRXmlDataSource(stringToDom(xmlResult));
  
  HashMap parameterMap = new HashMap();
  parameterMap.put("TITLE_MSG_PARAM", fUECRptMsg);
  parameterMap.put("SURVEY_YEAR_PARAM", surveyYear);              
  parameterMap.put("STATE_CODE_PARAM", fipsStateCode);
  
  JasperRunManager.runReportToPdfStream(reportStream,servletOutputStream, parameterMap,xmlDataSource);
  response.setContentType("application/pdf");
  servletOutputStream.flush();
  servletOutputStream.close();
  
  //this is the function that is converting the xmlsource to Document
  public static Document stringToDom(String xmlSource)  throws SAXException, ParserConfigurationException, IOException { 
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();  
      DocumentBuilder builder = factory.newDocumentBuilder();
      return builder.parse(new InputSource(new StringReader(xmlSource)));  
  } 
  </code></pre>
  
  <p>When I ran, I get a null pointer exception in the line:</p>
  
  <pre><code>JasperRunManager.runReportToPdfStream(*reportStream*,servletOutputStream, parameterMap,xmlDataSource);
  </code></pre>
  
  <p>saying reportStream is null</p>
  
  <p>Anybody please let me know where the problem is.</p>
  
  <p>When I run and compile from ireport, I am successfully able to open the PDF.</p>
  
  <p>Thanks</p>
  
  <p>GK</p>