question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ClassCastException in JpaHibernateConnectionProvider with spring 5.3

See original GitHub issue

Exception: 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:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
bartoszwalacikcommented, Nov 14, 2020

fixed in 5.14.0

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found