title: Using JasperRunManager on JSP: JasperRunManager can not be resolved
body: <p>I have a problem with <em>JasperReports 2.0.5</em>, I want to see a report on web graphic format pdf. </p>
  
  <p>I'm writing these code :</p>
  
  <pre><code>&lt;% @ Page errorPage = " error.jsp "% &gt;
  &lt;% @ Page import = " net.sf.jasperreports.engine . * "% &gt;
  &lt;% @ Page import = " net.sf.jasperreports.engine.util . * "% &gt;
  &lt;% @ Page import = " net.sf.jasperreports.engine.export . * "% &gt;
  &lt;% @ Page import = " java.util . * "% &gt;
  &lt;% @ Page import = " java.io. * "% &gt;
  &lt;% @ Page import = " java.sql . * "% &gt;
  &lt;% @ Page import = " javax.naming . * "% &gt;
  InitContext context = new InitialContext ();
  EnvContext context = ( Context) initContext.lookup ( " java :/ comp / env ");
  DataSource ds = (DataSource) envContext.lookup ( " jdbcLink ");
  Connection conn = ds.getConnection ();
  
    / / PDF View
  ReportFile File = new File ( application.getRealPath ( "Reports / WebReport.jasper "));
  Map parameters = new HashMap ();
  byte [ ] bytes = JasperRunManager.runReportToPdf ( reportFile.getPath ( ) , parameters, conn ) ;
  response.setContentType ( " application / pdf ");
  response.setContentLength ( bytes.length ) ;
  ServletOutputStream ouputStream = response.getOutputStream ();
  ouputStream.write ( bytes , 0, bytes.length ) ;
  ouputStream.flush ( ) ;
  ouputStream.close ( ) ;
  </code></pre>
  
  <p>And it gives me this error :</p>
  
  <pre><code>org.apache.jasper.JasperException : Unable to compile class for JSP :
  
  An error occurred at line : 32 in the jsp file: / Reports / test.jsp
  JasperRunManager can not be resolved
  29 : File reportFile = new File ( application.getRealPath ( "Reports /      WebReport.jasper "));
  30 : Map parameters = new HashMap ();
  31 : out.println ( parameters ) ;
  32 : byte [ ] bytes = JasperRunManager.runReportToPdf ( reportFile.getPath ( ) , parameters , conn ) ;
  33 : response.setContentType ( " application / pdf ");
  34 : response.setContentLength ( bytes.length ) ;
  35 : ServletOutputStream ouputStream = response.getOutputStream ();
  
  
  Stacktrace :
  org.apache.jasper.compiler.DefaultErrorHandler.javacError ( DefaultErrorHandler.java : 93)
  org.apache.jasper.compiler.ErrorDispatcher.javacError ( ErrorDispatcher.java : 330 )
  org.apache.jasper.compiler.JDTCompiler.generateClass ( JDTCompiler.java : 435 )
  org.apache.jasper.compiler.Compiler.compile ( Compiler.java : 298)  
  org.apache.jasper.compiler.Compiler.compile ( Compiler.java : 277)
  org.apache.jasper.compiler.Compiler.compile ( Compiler.java : 265)
  org.apache.jasper.JspCompilationContext.compile ( JspCompilationContext.java : 564 )
  org.apache.jasper.servlet.JspServletWrapper.service ( JspServletWrapper.java : 302 )
  org.apache.jasper.servlet.JspServlet.serviceJspFile ( JspServlet.java : 329 )
  org.apache.jasper.servlet.JspServlet.service ( JspServlet.java : 265)
  javax.servlet.http.HttpServlet.service ( HttpServlet.java : 803 )
  </code></pre>
  
  <p>In the lib folder I have included these jars:</p>
  
  <pre><code>-Groovy-all-1.0.jar
  -IText-1.3.1.jar
  -JasperReports-2.0.5.jar
  -Poi-3.0.1-FINAL-20070705.jar
  -Commons-beanutils-1.7.jar
  -Commons-collections-2.1.jar
  -Commons-logging-1.0.2.jar
  </code></pre>
  
  <p>Sorry for my English</p>