spring-data-jpa icon indicating copy to clipboard operation
spring-data-jpa copied to clipboard

EnableJpaRepositories repositoryFactoryBeanClass has bug

Open FPEsocrter opened this issue 2 years ago • 4 comments

image EnableJpaRepositories repositoryFactoryBeanClass Configured factory in Query query getEntityManager().createNativeQuery NativeQueryImpl unwrap = query.unwrap(NativeQueryImpl.class); image

java.lang.ClassCastException: class jdk.proxy2.$Proxy142 cannot be cast to class org.hibernate.query.sql.internal.NativeQueryImpl (jdk.proxy2.$Proxy142 is in module jdk.proxy2 of loader 'app'; org.hibernate.query.sql.internal.NativeQueryImpl is in unnamed module of loader 'app')

DeferredQueryInvocationHandler invoke

image proxy is JdkProxy

should use image

FPEsocrter avatar Dec 06 '23 05:12 FPEsocrter

on @SpringBootTest Exception 。

It’s OK to start the web service normally

strangeness ??

pom are all the same

FPEsocrter avatar Dec 06 '23 07:12 FPEsocrter

Where in our code is query.unwrap(NativeQueryImpl.class);?

If you would like us to spend some time helping you to diagnose the problem, please spend some time describing it and, ideally, providing a minimal yet complete sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue.

mp911de avatar Dec 06 '23 09:12 mp911de

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

spring-projects-issues avatar Dec 13 '23 09:12 spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

spring-projects-issues avatar Dec 20 '23 09:12 spring-projects-issues