0

I want to create a Module to generate reports using OSGI (Felix in Glassfish),

First, I have downloaded and deployed the Jasper Reports Bundle, The Deploy returns "OK"

After, I have created a Project Bundle that imports the Jasper Reports Packages, the Deploy of Bundle returns "OK"

I take the OutputStream of the Servlet and I Take the Jasper InputStream from another Bundle, and process this with this Code.

public void generateReportFromDatasource(InputStream inputStream,
                                         OutputStream outputStream,
 Map parameters,
 JRDataSource jrDataSource) {

    try {
        JasperRunManager.runReportToPdfStream(inputStream, outputStream,
                parameters,jrDataSource);

    } catch (Throwable e) {
        logger.error(e.getMessage(), e);
    }
}

But, the Jasper Report result is a Error, But i cannot read cleary.

[2014-10-23T17:22:36.362-0300] [glassfish 4.0] [SEVERE] [] [] [tid: _ThreadID=24     _ThreadName=Thread-4] [timeMillis: 1414095756362] [levelValue: 1000] [[
java.lang.NoClassDefFoundError: Could not initialize class net.sf.jasperreports.engine.util.JRStyledTextParser
    at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:124)
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:89)
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:104)
   at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:62)
   at net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:179)
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:108)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:668)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:649)
at net.sf.jasperreports.engine.JasperRunManager.runToPdfStream(JasperRunManager.java:437)
at net.sf.jasperreports.engine.JasperRunManager.runReportToPdfStream(JasperRunManager.java:858)
at com.roshka.javorai.report.client.JavoraiReportManagerimpl.generateReportFromDatasource(JavoraiReportManagerimpl.java:75)

My question is, I don't cant see the Error, because the JasperReports Bundle have the JRStyledTextParser and I cant see the Class that it says that not has Found.

jrey
  • 2,163
  • 1
  • 32
  • 48

1 Answers1

1

You need to make sure you have all required packages imported. The Manifest of your servlet containing bundle needs to import it like the following:

Package-Import: net.sf.jasperreports.engine.util
Achim Nierbeck
  • 5,265
  • 2
  • 14
  • 22