4 Replies Latest reply: Jan 20, 2009 2:46 AM by 807575 RSS

    I have tried to implement jasper report but getting exceptions at run time

    807575
      I have tried to implement jasper report but getting exceptions at run time and I couldn't get the reason of these exceptions. please give me idea to solve this problem.

      I am using following jar files for this :
      commons-beanutils-1.6.1.jar
      commons-digester-1.7.jar
      commons-logging.jar
      jasperreports-1.2.0.jar

      code is as follows:-
      (1) xml:
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jasperReport
      PUBLIC "-//JasperReports//DTD Report Design//EN"
      "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">

      <jasperReport name="Simple_Report">
      <detail>
      <band height="20">
      <staticText>
      <reportElement x="180" y="0" width="200" height="20"/>
      <text><![CDATA[Hello World!]]></text>
      </staticText>
      </band>
      </detail>
      </jasperReport>
      (2.) java file
      import net.sf.jasperreports.engine.*;
      import net.sf.jasperreports.engine.xml.*;
      import org.xml.sax.*;
      import org.apache.commons.digester.Digester;
      import org.apache.commons.digester.RuleSetBase;

      import java.util.*;

      public class JasperReportsIntro
      {
      public static void main(String[] args)
      {
      JasperReport jasperReport;
      JasperPrint jasperPrint;
      try
      {
           jasperReport = JasperCompileManager.compileReport(
      "jasperreports_demo.jrxml");
      jasperPrint = JasperFillManager.fillReport(
      jasperReport, new HashMap(), new JREmptyDataSource());
      // JasperExportManager.exportReportToPdfFile(
      // jasperPrint, "jasperReports/simple_report.pdf");
      }
      catch (JRException e)
      {
      e.printStackTrace();
      }
      }
      }

      I am getting exceptions like:
      net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:
      /home/navneet/Simple_Report_1143636234024_954843.java:4: package net.sf.jasperreports.engine does not exist
      import net.sf.jasperreports.engine.*;
      ^
      /home/navneet/Simple_Report_1143636234024_954843.java:5: package net.sf.jasperreports.engine.fill does not exist
      import net.sf.jasperreports.engine.fill.*;
      ^
      /home/navneet/Simple_Report_1143636234024_954843.java:18: cannot find symbol
      symbol: class JREvaluator
      public class Simple_Report_1143636234024_954843 extends JREvaluator
      ^
      /home/navneet/Simple_Report_1143636234024_954843.java:25: cannot find symbol
      symbol : class JRFillParameter
      location: class Simple_Report_1143636234024_954843
      private JRFillParameter parameter_REPORT_RESOURCE_BUNDLE = null;
      ^
      /home/navneet/Simple_Report_1143636234024_954843.java:26: cannot find symbol
      symbol : class JRFillParameter
      location: class Simple_Report_1143636234024_954843
      private JRFillParameter parameter_REPORT_CONNECTION = null;
      ^
      /home/navneet/Simple_Report_1143636234024_954843.java:27: cannot find symbol
      symbol : class JRFillParameter
      location: class Simple_Report_1143636234024_954843
      private JRFillParameter parameter_REPORT_PARAMETERS_MAP = null;
      ^
      /home/navneet/Simple_Report_1143636234024_954843.java:28: cannot find symbol
      symbol : class JRFillParameter
      location: class Simple_Report_1143636234024_954843
      private JRFillParameter parameter_IS_IGNORE_PAGINATION = null;
      ^
      /home/navneet/Simple_Report_1143636234024_954843.java:29: cannot find symbol
      symbol : class JRFillParameter
      location: class Simple_Report_1143636234024_954843
      private JRFillParameter parameter_REPORT_CLASS_LOADER = null;
      ^
      /home/navneet/Simple_Report_1143636234024_954843.java:30: cannot find symbol
      symbol : class JRFillParameter
      location: class Simple_Report_1143636234024_954843
      private JRFillParameter parameter_REPORT_VIRTUALIZER = null;
      ^
      /home/navneet/Simple_Report_1143636234024_954843.java:31: cannot find symbol
      symbol : class JRFillParameter
      location: class Simple_Report_1143636234024_954843
      private JRFillParameter parameter_REPORT_LOCALE = null;
      ^
      /home/navneet/Simple_Report_1143636234024_954843.java:32: cannot find symbol
      symbol : class JRFillParameter
      location: class Simple_Report_1143636234024_954843
      private JRFillParameter parameter_REPORT_DATA_SOURCE = null;
      ^
      /home/navneet/Simple_Report_1143636234024_954843.java:33: cannot find symbol
      symbol : class JRFillParameter
      location: class Simple_Report_1143636234024_954843
      private JRFillParameter parameter_REPORT_SCRIPTLET = null;
      ^
      /home/navneet/Simple_Report_1143636234024_954843.java:34: cannot find symbol
      symbol : class JRFillParameter
      location: class Simple_Report_1143636234024_954843
      private JRFillParameter parameter_REPORT_MAX_COUNT = null;
      ^
      /home/navneet/Simple_Report_1143636234024_954843.java:35: cannot find symbol
      symbol : class JRFillVariable
      location: class Simple_Report_1143636234024_954843
      private JRFillVariable variable_PAGE_NUMBER = null;
      ^
      /home/navneet/Simple_Report_1143636234024_954843.java:36: cannot find symbol
      symbol : class JRFillVariable
      location: class Simple_Report_1143636234024_954843
      private JRFillVariable variable_COLUMN_NUMBER = null;
      ^
      /home/navneet/Simple_Report_1143636234024_954843.java:37: cannot find symbol
      symbol : class JRFillVariable
      location: class Simple_Report_1143636234024_954843
      private JRFillVariable variable_REPORT_COUNT = null;
      ^
      /home/navneet/Simple_Report_1143636234024_954843.java:38: cannot find symbol
      symbol : class JRFillVariable
      location: class Simple_Report_1143636234024_954843
      private JRFillVariable variable_PAGE_COUNT = null;
      ^
      /home/navneet/Simple_Report_1143636234024_954843.java:39: cannot find symbol
      symbol : class JRFillVariable
      location: class Simple_Report_1143636234024_954843
      private JRFillVariable variable_COLUMN_COUNT = null;
      ^
      /home/navneet/Simple_Report_1143636234024_954843.java:62: cannot find symbol
      symbol : class JRFillParameter
      location: class Simple_Report_1143636234024_954843
      parameter_REPORT_RESOURCE_BUNDLE = (JRFillParameter)pm.get("REPORT_RESOURCE_BUNDLE");
      ^
      /home/navneet/Simple_Report_1143636234024_954843.java:63: cannot find symbol
      symbol : class JRFillParameter
      location: class Simple_Report_1143636234024_954843
      parameter_REPORT_CONNECTION = (JRFillParameter)pm.get("REPORT_CONNECTION");
      ^
      /home/navneet/Simple_Report_1143636234024_954843.java:64: cannot find symbol
      symbol : class JRFillParameter
      location: class Simple_Report_1143636234024_954843
      parameter_REPORT_PARAMETERS_MAP = (JRFillParameter)pm.get("REPORT_PARAMETERS_MAP");
      ^
      /home/navneet/Simple_Report_1143636234024_954843.java:65: cannot find symbol
      symbol : class JRFillParameter
      location: class Simple_Report_1143636234024_954843
      parameter_IS_IGNORE_PAGINATION = (JRFillParameter)pm.get("IS_IGNORE_PAGINATION");
      ^
      /home/navneet/Simple_Report_1143636234024_954843.java:66: cannot find symbol
      symbol : class JRFillParameter
      location: class Simple_Report_1143636234024_954843
      parameter_REPORT_CLASS_LOADER = (JRFillParameter)pm.get("REPORT_CLASS_LOADER");
      ^
      /home/navneet/Simple_Report_1143636234024_954843.java:67: cannot find symbol
      symbol : class JRFillParameter
      location: class Simple_Report_1143636234024_954843
      parameter_REPORT_VIRTUALIZER = (JRFillParameter)pm.get("REPORT_VIRTUALIZER");
      ^
      /home/navneet/Simple_Report_1143636234024_954843.java:68: cannot find symbol
      symbol : class JRFillParameter
      location: class Simple_Report_1143636234024_954843
      parameter_REPORT_LOCALE = (JRFillParameter)pm.get("REPORT_LOCALE");
      ^
      /home/navneet/Simple_Report_1143636234024_954843.java:69: cannot find symbol
      symbol : class JRFillParameter
      location: class Simple_Report_1143636234024_954843
      parameter_REPORT_DATA_SOURCE = (JRFillParameter)pm.get("REPORT_DATA_SOURCE");
      ^
      /home/navneet/Simple_Report_1143636234024_954843.java:70: cannot find symbol
      symbol : class JRFillParameter
      location: class Simple_Report_1143636234024_954843
      parameter_REPORT_SCRIPTLET = (JRFillParameter)pm.get("REPORT_SCRIPTLET");
      ^
      /home/navneet/Simple_Report_1143636234024_954843.java:71: cannot find symbol
      symbol : class JRFillParameter
      location: class Simple_Report_1143636234024_954843
      parameter_REPORT_MAX_COUNT = (JRFillParameter)pm.get("REPORT_MAX_COUNT");
      ^
      /home/navneet/Simple_Report_1143636234024_954843.java:88: cannot find symbol
      symbol : class JRFillVariable
      location: class Simple_Report_1143636234024_954843
      variable_PAGE_NUMBER = (JRFillVariable)vm.get("PAGE_NUMBER");
      ^
      /home/navneet/Simple_Report_1143636234024_954843.java:89: cannot find symbol
      symbol : class JRFillVariable
      location: class Simple_Report_1143636234024_954843
      variable_COLUMN_NUMBER = (JRFillVariable)vm.get("COLUMN_NUMBER");
      ^
      /home/navneet/Simple_Report_1143636234024_954843.java:90: cannot find symbol
      symbol : class JRFillVariable
      location: class Simple_Report_1143636234024_954843
      variable_REPORT_COUNT = (JRFillVariable)vm.get("REPORT_COUNT");
      ^
      /home/navneet/Simple_Report_1143636234024_954843.java:91: cannot find symbol
      symbol : class JRFillVariable
      location: class Simple_Report_1143636234024_954843
      variable_PAGE_COUNT = (JRFillVariable)vm.get("PAGE_COUNT");
      ^
      /home/navneet/Simple_Report_1143636234024_954843.java:92: cannot find symbol
      symbol : class JRFillVariable
      location: class Simple_Report_1143636234024_954843
      variable_COLUMN_COUNT = (JRFillVariable)vm.get("COLUMN_COUNT");
      ^
      33 errors

      at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:193)
      at net.sf.jasperreports.engine.design.JRDefaultCompiler.compileReport(JRDefaultCompiler.java:131)
      at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:211)
      at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:144)
      at com.appnetix.app.portal.financials.reports.RoyaltyReportAction.execute(RoyaltyReportAction.java:68)
      at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
      at com.appnetix.app.control.web.AppnetixRequestProcessor.process(AppnetixRequestProcessor.java:149)
      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
      at com.appnetix.app.control.web.AppnetixControllerServlet.doPost(AppnetixControllerServlet.java:262)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
      at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
      at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
      at java.lang.Thread.run(Thread.java:595)