Jump to content
Changes to the Jaspersoft community edition download ×

Jasper report compilation error


2004 IR Help

Recommended Posts

By: pagux - cool_gaurav

Jasper report compilation error

2005-04-11 02:17

Hi,

I have made a class which to output report.

I have included all jars in path but still I am getting errors

"org.apache.commons.digester.Digester endElement

SEVERE: End event threw error"

here is classpath and jars included

export CLASSPATH=".:/opt/jars/ojdbc14.jar:/opt/jasper/jasperreports-0.6.6.jar:/opt/lib/commons/commons-digester-1.6/commons-digester.jar:/opt/lib/commons/commons-logging-1.0.4/commons-logging.jar:/opt/lib/commons/commons-collections-3.1/commons-collections-3.1.jar:/opt/lib/itext/itext-1.3.jar:/opt/lib/poi/poi-2.5.1-final-20040804.jar"

I am using commons-digester-1.6 is this verrsion supported or i should use commons-digester-1.3.x

 

My Java class

import java.sql.Connection;

import java.sql.SQLException;

import java.util.HashMap;

import java.util.Map;

 

 

 

 

import net.sf.jasperreports.engine.JRException;

import net.sf.jasperreports.engine.xml.JRXmlLoader;

import net.sf.jasperreports.engine.JasperCompileManager;

import net.sf.jasperreports.engine.JasperFillManager;

import net.sf.jasperreports.engine.JasperExportManager;

import net.sf.jasperreports.engine.JasperPrint;

import net.sf.jasperreports.engine.JasperReport;

import net.sf.jasperreports.engine.design.JasperDesign;

import net.sf.jasperreports.view.JasperViewer;

// import net.sf.jasperreports.*;

//import nl.amis.database.Database;

import java.sql.*;

 

 

 

 

public class TestJasper {

 

 

public static void main(String[] args) {

// First, load JasperDesign from XML and compile it into JasperReport

try {

JasperDesign jasperDesign = JRXmlLoader.load("TestJasper.xml");

JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);

 

Connection con;

//DatabaseMetaData meta;

String url = "jdbc:oracle:thin:@cl-node5:1521:s";

String user = "topcat";

String password = "topcat";

 

 

DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

con = DriverManager.getConnection(url, user, password);

 

 

 

 

 

 

 

 

 

 

 

 

 

 

// Second, create a map of parameters to pass to the report.

 

Map parameters = new HashMap();

parameters.put("Title", "Test JasperReport");

 

 

 

// Third, get a database connection

 

//Connection conn = Database.getConnection();

 

 

 

// Fourth, create JasperPrint using fillReport() method

 

JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport,parameters,con);

 

 

 

// You can use JasperPrint to create PDF

 

JasperExportManager.exportReportToPdfFile(jasperPrint, "TestJasper.pdf");

 

 

 

// Or to view report in the JasperViewer

 

JasperViewer.viewReport(jasperPrint);

} catch (JRException e) {

// TODO Auto-generated catch block

e.printStackTrace();

} catch (SQLException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

}

}

 

full error trace

java TestJasper

Apr 11, 2005 2:37:11 PM org.apache.commons.digester.Digester endElement

SEVERE: End event threw error

java.lang.NoClassDefFoundError: org/apache/commons/beanutils/MethodUtils

at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:208)

at org.apache.commons.digester.Rule.end(Rule.java:228)

at org.apache.commons.digester.Digester.endElement(Digester.java:1067)

at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:633)

at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:221)

at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.emptyElement(XMLDTDValidator.java:819)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:872)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1693)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)

at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)

at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)

at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)

at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)

at org.apache.commons.digester.Digester.parse(Digester.java:1591)

at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:357)

at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:341)

at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:295)

at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:279)

at TestJasper.main(TestJasper.java:31)

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/beanutils/MethodUtils

at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:208)

at org.apache.commons.digester.Rule.end(Rule.java:228)

at org.apache.commons.digester.Digester.endElement(Digester.java:1067)

at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:633)

at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:221)

at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.emptyElement(XMLDTDValidator.java:819)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:872)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1693)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)

at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)

at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)

at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)

at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)

at org.apache.commons.digester.Digester.parse(Digester.java:1591)

at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:357)

at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:341)

at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:295)

at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:279)

at TestJasper.main(TestJasper.java:31)

 

 

 

 

 

 

 

 

By: Teodor Danciu - teodord

RE: Jasper report compilation error

2005-04-11 17:46

 

Hi,

 

The Jakarta Commons BeanUtils library is missing from

you classpath.

 

I hope this helps.

Teodor

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...