I\'m building web app based on maven, using spring, hibernate and jasperreports.
Here is applicationContext.xml file
Like is written here http://jasperreports.sourceforge.net/sample.reference/hibernate/
One of these middle-tier tools dedicated to data access is Hibernate (today: Hibernate 3.3) (...)
... is it possible that newest jasperreports 5.6 believes that actual version of hibernate is 3.3 and not 4.3? oO
Two weeks working on a solution and nothing :/
From the jasperreports 5.6.0 pom
...
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.0.5</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
</exclusion>
</exclusions>
<optional>true</optional>
</dependency>
...
It does bring in hibernate 3.
This is a snippet from a class in JasperReports 5.6.0 where jasperreports is trying to find that hibernate.BOOLEAN class.
import org.hibernate.Hibernate;
import org.hibernate.Query;
import org.hibernate.ScrollMode;
import org.hibernate.ScrollableResults;
import org.hibernate.Session;
import org.hibernate.type.Type;
/**
* HQL query executer that uses Hibernate 3.
*
* @author Lucian Chirita (lucianc@users.sourceforge.net)
* @version $Id: JRHibernateQueryExecuter.java 7199 2014-08-27 13:58:10Z teodord $
*/
public class JRHibernateQueryExecuter extends JRAbstractQueryExecuter
{
private static final Log log = LogFactory.getLog(JRHibernateQueryExecuter.class);
protected static final String CANONICAL_LANGUAGE = "HQL";
private static final Map<Class<?>,Type> hibernateTypeMap;
static
{
hibernateTypeMap = new HashMap<Class<?>,Type>();
hibernateTypeMap.put(Boolean.class, Hibernate.BOOLEAN);
hibernateTypeMap.put(Byte.class, Hibernate.BYTE);
hibernateTypeMap.put(Double.class, Hibernate.DOUBLE);
hibernateTypeMap.put(Float.class, Hibernate.FLOAT);
hibernateTypeMap.put(Integer.class, Hibernate.INTEGER);
...
As long as you are trying to use that version of JRHibernateQueryExecutor you are going to be limited to Hibernate 3.0.
Here you can see the history of JRHibernateQueryExecutor in JasperReports development tree.
I believe you would need this change in order to support newer hibernate versions.
That change was submitted in June of 2015.
If you look at the history of the jasperreports releases at mvnrepository.com you'll see that 6.1.1 is the first release to maven that could include the change you need to use newer versions of hibernate.
I just tried using 5.6.0 (and also 6.1.0) with Hibernate 4 and duplicated your error. I then tried using 6.1.1 and that error disappeared.