Jump to content
Changes to the Jaspersoft community edition download ×

JasperReports 3.7.6 and Hibernate 3.6 Errors


userjc

Recommended Posts

I am using JasperReports in my application - where I am using Spring, Hibernate and JasperReports.  I have just updated our version of Hibernate from 3.2.7 to 3.6 and JasperReports from 3.1.3 to 3.7.6.  However, I am not getting a NoClassDefFoundError (see below) without any indication of what class is missing. 

 java.lang.NoClassDefFoundError
    at net.sf.jasperreports.engine.query.JRHibernateQueryExecuterFactory.createQueryExecuter(JRHibernateQueryExecuterFactory.java:135)
    at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:681)
    at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:605)
    at net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(JRBaseFiller.java:1281)
    at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:901)
    at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:118)
    at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:435)
    at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:398)

This exception is thrown when I make a call to JasperRunManager.runReportToPdfStream:

        try {
            JasperRunManager.runReportToPdfStream(reportFormatInputStream,
                    servletOutputStream, parameters);
        } catch (JRException e) {
            e.printStackTrace();
        }

 

This was working before I made my upgrades.  Does anyone have any insight on the issue that I am running into?

Link to comment
Share on other sites

  • 4 weeks later...
  • Replies 8
  • Created
  • Last Reply

Top Posters In This Topic

I am too having similar problems with Hibernate 3.6. Maybe this has something to do with changes in Hibernate data type definition? Previously Hibernate.BOOLEAN, in 3.6 StandardBasicTypes.BOOLEAN. Do we need a new release of JasperReports to support Hibernate 3.6?

Stack trace:

java.lang.NoSuchFieldError: BOOLEAN	net.sf.jasperreports.engine.query.JRHibernateQueryExecuter.<clinit>(JRHibernateQueryExecuter.java:70)	net.sf.jasperreports.engine.query.JRHibernateQueryExecuterFactory.createQueryExecuter(JRHibernateQueryExecuterFactory.java:135)	net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:681)	net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:605)	net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(JRBaseFiller.java:1281)	net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:901)	net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:118)	net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:435)


Link to comment
Share on other sites

  • 1 month later...

I solved the problem by simply recompiling Jasper against latest hibernate3.jar. No actual code change was necessary.

The reason is that Hibernate.BOOLEAN (and others) are declared as final, so the compiler "took" their signature when it created original jasperreports.jar.

 

 

 

 

Link to comment
Share on other sites

  • 3 months later...

I got the same Error. In my case when I put a Collection as DataSource it works...

 

 DAO dao = DAO.getInstance(DAO.HIBERNATE);

List<Object> users = dao.find(User.class);

JRDataSource ds = new JRBeanCollectionDataSource(users);

...

// It works

 

JasperPrint print = JasperFillManager.fillReport(report, parameters, ds);

 

 

But if I remove the dataset and pass the Hibernate Session as parameter I got the error.... 

 

// java.lang.NoSuchFieldError: BOOLEAN JRHibernateQueryExecuter.<clinit>(JRHibernateQueryExecuter.java:70)

parameters.put("HIBERNATE_SESSION", dao.getSession());

JasperPrint print = JasperFillManager.fillReport(report, parameters);

 

Does someone know if I'm doing anything wrong? Can someone send the compiled version which works properly?

Link to comment
Share on other sites

  • 1 month later...

aparfeno
Wrote:

I solved the problem by simply recompiling Jasper against latest hibernate3.jar. No actual code change was necessary.

The reason is that Hibernate.BOOLEAN (and others) are declared as final, so the compiler "took" their signature when it created original jasperreports.jar.

I have same problem. How do you recompile Jasper ? Thank you.

 



Post Edited by brouardbas at 07/05/2011 15:44



Post Edited by brouardbas at 07/05/2011 15:45
Link to comment
Share on other sites

  • 2 months later...
  • 2 weeks later...
  • 2 years later...

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