title: Jasper plugin for Grails: Cannot invoke method generateReport() on null object
body: <p>I am using Jasper plugin (v 1.5.3) for Grails (v 1.3.7). I have written following code in a method of a Service</p>
  
  <pre><code>import org.codehaus.groovy.grails.plugins.jasper.JasperExportFormat;
  import org.codehaus.groovy.grails.plugins.jasper.JasperReportDef;
  import org.apache.commons.io.FileUtils;
  
  class ReportService {
  
      static transactional = true
      def jasperService
  
      def generateFormA() {
          def reportDef = new JasperReportDef(name:'test.jasper', fileFormat:JasperExportFormat.PDF_FORMAT)   
          FileUtils.writeByteArrayToFile(new File('C:/test.pdf'), jasperService.generateReport(reportDef).toByteArray())
  
          return
      }
  }
  </code></pre>
  
  <p>I am getting following run-time error when I call the Service method - </p>
  
  <blockquote>
    <p>Cannot invoke method generateReport() on null object</p>
  </blockquote>
  
  <p>I have injected jasperService and imported required classes as described in the <a href="http://grails.org/plugin/jasper" rel="nofollow">plugin</a> page. Moreover, when I debug, I noticed that reportDef is being instantiated properly.</p>
  
  <p>Can anyone suggest anything. Appreciate your help.</p>