Jump to content
Changes to the Jaspersoft community edition download ×

ArrayStack in Digester


2004 IR Help

Recommended Posts

By: sundile - sundile

ArrayStack in Digester

2005-04-22 07:54

 

 

Here I hava just included my program and the errors it gives.

import java.io.*;

import java.io.File;

import java.io.InputStream;

import java.io.FileInputStream;

import java.io.FileWriter;

import java.io.FileReader;

import java.io.IOException;

import java.util.HashMap;

import java.util.Map;

import java.lang.*;

import java.sql.*;

 

import net.sf.jasperreports.engine.*;

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

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

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

import net.sf.jasperreports.engine.data.*;

import net.sf.jasperreports.engine.JasperCompileManager;

//import net.sf.jasperreports.engine.JasperManager.*;

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

import net.sf.jasperreports.engine.export.*;

import net.sf.jasperreports.view.JasperViewer;

import net.sf.jasperreports.engine.util.*; ?

import java.awt.Color.*; ?

?

public class nelson{ ?

?

public static void main(String[] args ) ?

{ ?

try{ ?

?

try { ?

// InputStream input = new FileInputStream(new File("C:/celsoft?

JasperDesign design = JRXmlLoader.load("C:/celsoft/reports/ex?

// JasperDesign design = JRXmlLoader.load(input); ?

JasperReport report = JasperCompileManager.compileReport(desig?

?

/* JasperDesign design; ?

?

JRXmlLoader ld = new JRXmlLoader(); ?

design = ld.loadXML(input); ?

JasperReport report = JasperCompileManager.compileReport(desi?

//JRXmlLoader jrLoader = new JRXmlLoader(org.apache.commons.digeste?

//JasperDesign design = jrLoader.load("C:/celsoft/reports/example2.?

?

?

?

try{ ?

Connection cn = DriverManager.getConnection("jobs"); ?

?

String querry = "SELECT fstnam,idynum FROM jobs.rscmst"; ?

System.out.println(querry); ?

?

Statement stmt = cn.createStatement(); ?

ResultSet rs = stmt.executeQuery(querry); ?

JRDataSource dataSource = new JRResultSetDataSource(rs); ?

?

Map params = new HashMap(); ?

params.put("fstnam", "sandile"); ?

params.put("idynum", "8009055931086"); ?

?

JasperPrint print = JasperFillManager.fillReport(report, null, ?

System.out.println("The next statement should show a report!");

 

JasperViewer.viewReport(print); ?

JasperExportManager.exportReportToPdfFile(print, "exampleP.pdf"?

?

?

} ?

catch (SQLException e) ?

{ ?

System.out.println(e.toString()); ?

} ?

?

?

?

?

} ?

catch(JRException e) ?

{ ?

System.out.println("Failed to connect database. "+"n"+e.toString()?

} ?

} ?

catch(Exception e){ ?

System.out.println(e.toString()); ?

} ?

 

}

}

 

 

 

These are the errors

Microsoft Windows [Version 5.2.3790]

© Copyright 1985-2003 Microsoft Corp.

 

C:Documents and Settingssandile>cd

 

C:>cd celsoftreports

 

C:celsoftreports>javac nelson.java

 

C:celsoftreports>java nelson

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

llections/ArrayStack

at org.apache.commons.digester.Digester.<init>(Digester.java:189)

at net.sf.jasperreports.engine.xml.JRXmlDigester.<init>(JRXmlDigester.ja

va:64)

at net.sf.jasperreports.engine.xml.JRXmlDigesterFactory.createDigester(J

RXmlDigesterFactory.java:295)

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

)

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

)

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

)

at nelson.main(nelson.java:34)

 

C:celsoftreports>

 

Can somebody help me figure out what does it means.

 

 

 

 

By: Denny Valliant - xenden

RE: ArrayStack in Digester

2005-04-22 10:53

I'm no expert, to take with a grain of salt...

 

I think you are missing your commons-logging jar(s). You'll see in the lib directory of the project dist 2 or three commons-logging jars. Make sure those are available to yer app.

 

Also, it's Best Practices to define your jasper class path, which might be part of your problem.

 

//report class path

System.setProperty("jasper.reports.compile.class.path", theClassPath);

//temp file loc

System.setProperty("jasper.reports.compile.temp", theReportsPath);

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...