userjc Posted November 30, 2010 Share Posted November 30, 2010 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 More sharing options...
RKo Posted December 29, 2010 Share Posted December 29, 2010 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 More sharing options...
andersaa Posted February 22, 2011 Share Posted February 22, 2011 We are having the same problem with Hibernate 3.6.1 and JasperReports 4.0.0 (java.lang.NoSuchFieldError: BOOLEAN)More info about the change in Hibernate can be found here:http://opensource.atlassian.com/projects/hibernate/browse/HHH-5138Post Edited by andersaa at 02/22/2011 13:17 Link to comment Share on other sites More sharing options...
aparfeno Posted February 24, 2011 Share Posted February 24, 2011 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 More sharing options...
nanndoj Posted May 31, 2011 Share Posted May 31, 2011 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 More sharing options...
brouardbas Posted July 5, 2011 Share Posted July 5, 2011 aparfenoWrote: 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:44Post Edited by brouardbas at 07/05/2011 15:45 Link to comment Share on other sites More sharing options...
icsmauricio Posted September 23, 2011 Share Posted September 23, 2011 So any news about this? iam getting the same err in Jasperreports 4.1 and Hibernate 3.6 Link to comment Share on other sites More sharing options...
kolja.ehlersiconplc.com Posted October 7, 2011 Share Posted October 7, 2011 I am confronted with the same problem. I wonder why there is no solutions for this. Link to comment Share on other sites More sharing options...
geston88 Posted June 9, 2014 Share Posted June 9, 2014 After 3 years... I'm using jasperreports 5.6.0 and Hibernate 4.1.6 and looks like I have still same problem. Is there any solution without changing jasperreports source code? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now