ClassCastException in JpaHibernateConnectionProvider with spring 5.3
See original GitHub issueException: java.lang.ClassCastException: class com.sun.proxy.$Proxy113 cannot be cast to class org.hibernate.internal.SessionImpl (com.sun.proxy.$Proxy113 and org.hibernate.internal.SessionImpl are in unnamed module of loader ‘app’) at org.javers.spring.jpa.JpaHibernateConnectionProvider.getConnection(JpaHibernateConnectionProvider.java:22)
Here
(SessionImpl)entityManager.unwrap(Session.class);
entityManager.unwrap(Session.class) now returns Proxy instead of SessionImpl instance, because of changes in HibernateJpaVendorAdapter: entityManagerInterface changed from HibernateEntityManager (deprecated) to Session.
Probable fix: (SessionImpl)entityManager.unwrap(SessionImpl.class);
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
java - Spring upgrade 5.3.5 results in ClassCastException ...
I am trying to upgrade Spring to 5.3.5 with hibernate version 5.4.30.Final. Dependencies used are: ----Attempt1---------- <m.spring>5.1.6.
Read more >Release notes — JaVers Documentation
1121 Fixed IllegalArgumentException when querying for object with solely TERMINAL snapshot. Dependencies aligned with Spring Boot 2.5.5: springVersion =5.3.
Read more >ClassCastException occured on Solver.solve in spring boot
Now that I know that this error is related to spring-boot-devtools, and that the error will not occur if spring-boot-devtools is removed, I...
Read more >Blog - Spring
Updates to the following versions: Spring Boot 2.7.6; Spring Framework 5.3.24; Spring Cloud 2021.0.5. Spring Shell. Spring Shell has been updated ...
Read more >ClassCastException with Sun/Spring LDAP classes in a plugin
Sun and Spring LDAP classes are exported inconsistently to plugins, causing: java.lang.ClassCastException: com.sun.jndi.ldap.LdapCtx cannot be ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

fixed in 5.14.0
https://github.com/javers/javers/pull/1035