1
hello! Guys I’m changing my Hibernate from version 4.3.8.Final to 5.2.3.Final. Now I’m not getting the Hibernate Session like I used to, like this:
(Session) manager.unwrap(Session.class);
Gives Cast error
:java.lang.ClassCastException: org.jboss.weldx.persistence.EntityManager$1993463486$Proxy$_$$_WeldClientProxy cannot be cast to org.hibernate.Session
Does anyone have any idea? From what I saw in the documentation it seems that it should be the same way. https://docs.jboss.org/hibernate/orm/5.2/userguide/html_single/Hibernate_User_Guide.html#pc-unwrap
As far as I can tell, it has something to do with the CDI I’m using, because ending some tests on another program without and it works...
– Edison Luis Werle