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 have been using 4.2.8-Final version of hibernate and was having this issue and went through the below answers/suggestions earlier. Here is the sequence of events I made - To get rid of the issue with 4.2.8-Final, was using "parent classes last" class loader approach in Websphere. Recently when the project grew in size (by having more hibernate related jar flavors), started to get the same issue.
Finally excluded the "javassist" from hibernate
org.hibernate
hibernate-core
${hibernate.version}
org.javassist
javassist
and added
org.javassist
javassist
3.18.1-GA
Even this didn't resolve the problem completely (still I had to use 'parent last' class loader approach with hibernate to get rid of the issue.
Finally I downgraded hibernate version from 4.2.8-Final to 4.2.7-Final and the issue is solved (I need not change my class loader preference in websphere admin console as parent last anymore)
Not exactly sure what change in 4.2.8 Hibernate is causing this issue. Curious to know.