Hello I am using developnig java web application and I am getting the next exception when I am trying to fetch data using hibernate
java.lang.ClassCastExcept
I had the same problem with Spring Data JPA. I confirm it comes from javassit conflict. The solution is :
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>javassist</artifactId>
<groupId>org.javassist</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.18.2-GA</version>
<scope>compile</scope>
</dependency>
I had similar issue on JBoss EAP 7.1.3 (EAP 6.0.1) for hibernate 4.2.x. Its because JBoss modules already contains javassist lib.
I solved it by creating jboss-deployment-structure.xml in WEB-INF directory with such content:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
<exclusions>
<module name="org.javassist"/>
</exclusions>
<local-last value="true" />
</deployment>
</jboss-deployment-structure>