Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnsupportedFeatureError: Proxy class defined by interfaces [interface org.hibernate.query.hql.spi.SqmQueryImplementor ... #324

Closed
rkudryashov opened this issue Jun 23, 2023 · 18 comments
Labels
bug Something isn't working

Comments

@rkudryashov
Copy link

rkudryashov commented Jun 23, 2023

Describe the bug
Spring Boot native app periodically polls DB using JPA repository; method of the repository throws an error. There is a chance scheduler has nothing to do with the bug.

To Reproduce
The bug can be reproduced using https://github.com/rkudryashov/sb-repro

Logs
Add logs to help explain your problem.

2023-06-23T15:12:25.001Z DEBUG 1 --- [   scheduling-1] c.r.o.u.task.InboxProcessingTask         : Start inbox polling iteration
2023-06-23T15:12:25.002Z ERROR 1 --- [   scheduling-1] o.s.s.s.TaskUtils$LoggingErrorHandler    : Unexpected error occurred in scheduled task

com.oracle.svm.core.jdk.UnsupportedFeatureError: Proxy class defined by interfaces [interface org.hibernate.query.hql.spi.SqmQueryImplementor, interface org.hibernate.query.sqm.internal.SqmInterpretationsKey$InterpretationsKeySource, interface org.hibernate.query.spi.DomainQueryExecutionContext, interface org.h
ibernate.query.SelectionQuery, interface org.hibernate.query.CommonQueryContract] not found. Generating proxy classes at runtime is not supported. Proxy classes need to be defined at image build time by specifying the list of interfaces that they implement. To define proxy classes use -H:DynamicProxyConfigurationFiles=<comma-separated-config-files> and -H:DynamicProxyConfigurationResources=<comma-separated-config-resources> options.
        at com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:89) ~[na:na]
        at com.oracle.svm.core.reflect.proxy.DynamicProxySupport.getProxyClass(DynamicProxySupport.java:171) ~[na:na]
        at [email protected]/java.lang.reflect.Proxy.getProxyConstructor(Proxy.java:47) ~[com.romankudryashov.outboxinbox.userservice.UserServiceApplicationKt:na]
        at [email protected]/java.lang.reflect.Proxy.newProxyInstance(Proxy.java:1037) ~[com.romankudryashov.outboxinbox.userservice.UserServiceApplicationKt:na]
        at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:316) ~[na:na]
        at jdk.proxy4/jdk.proxy4.$Proxy60.createQuery(Unknown Source) ~[na:na]
        at org.springframework.data.jpa.repository.query.PartTreeJpaQuery$QueryPreparer.createQuery(PartTreeJpaQuery.java:297) ~[com.romankudryashov.outboxinbox.userservice.UserServiceApplicationKt:3.1.1]
        at org.springframework.data.jpa.repository.query.PartTreeJpaQuery$QueryPreparer.createQuery(PartTreeJpaQuery.java:242) ~[com.romankudryashov.outboxinbox.userservice.UserServiceApplicationKt:3.1.1]
        at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.doCreateQuery(PartTreeJpaQuery.java:113) ~[na:na]
        at org.springframework.data.jpa.repository.query.AbstractJpaQuery.createQuery(AbstractJpaQuery.java:234) ~[com.romankudryashov.outboxinbox.userservice.UserServiceApplicationKt:3.1.1]
        at org.springframework.data.jpa.repository.query.JpaQueryExecution$CollectionExecution.doExecute(JpaQueryExecution.java:129) ~[na:na]
        at org.springframework.data.jpa.repository.query.JpaQueryExecution.execute(JpaQueryExecution.java:92) ~[com.romankudryashov.outboxinbox.userservice.UserServiceApplicationKt:3.1.1]
        at org.springframework.data.jpa.repository.query.AbstractJpaQuery.doExecute(AbstractJpaQuery.java:148) ~[com.romankudryashov.outboxinbox.userservice.UserServiceApplicationKt:3.1.1]
        at org.springframework.data.jpa.repository.query.AbstractJpaQuery.execute(AbstractJpaQuery.java:136) ~[com.romankudryashov.outboxinbox.userservice.UserServiceApplicationKt:3.1.1]
        at org.springframework.data.repository.core.support.RepositoryMethodInvoker.doInvoke(RepositoryMethodInvoker.java:136) ~[com.romankudryashov.outboxinbox.userservice.UserServiceApplicationKt:3.1.1]
        at org.springframework.data.repository.core.support.RepositoryMethodInvoker.invoke(RepositoryMethodInvoker.java:120) ~[com.romankudryashov.outboxinbox.userservice.UserServiceApplicationKt:3.1.1]
        at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.doInvoke(QueryExecutorMethodInterceptor.java:164) ~[na:na]
        at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.invoke(QueryExecutorMethodInterceptor.java:143) ~[na:na]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[com.romankudryashov.outboxinbox.userservice.UserServiceApplicationKt:6.0.10]
        at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:72) ~[na:na]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[com.romankudryashov.outboxinbox.userservice.UserServiceApplicationKt:6.0.10]
        at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) ~[na:na]
        at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:391) ~[com.romankudryashov.outboxinbox.userservice.UserServiceApplicationKt:6.0.10]
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) ~[com.romankudryashov.outboxinbox.userservice.UserServiceApplicationKt:6.0.10]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[com.romankudryashov.outboxinbox.userservice.UserServiceApplicationKt:6.0.10]
        at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:137) ~[na:na]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[com.romankudryashov.outboxinbox.userservice.UserServiceApplicationKt:6.0.10]
        at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:135) ~[na:na]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[com.romankudryashov.outboxinbox.userservice.UserServiceApplicationKt:6.0.10]
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) ~[na:na]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[com.romankudryashov.outboxinbox.userservice.UserServiceApplicationKt:6.0.10]
        at org.springframework.data.repository.core.support.MethodInvocationValidator.invoke(MethodInvocationValidator.java:94) ~[na:na]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[com.romankudryashov.outboxinbox.userservice.UserServiceApplicationKt:6.0.10]
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:244) ~[na:na]
        at jdk.proxy4/jdk.proxy4.$Proxy53.findFirst50ByStatusOrderByCreatedAtAsc(Unknown Source) ~[na:na]
        at com.romankudryashov.outboxinbox.userservice.task.InboxProcessingTask.execute(InboxProcessingTask.kt:28) ~[com.romankudryashov.outboxinbox.userservice.UserServiceApplicationKt:na]
        at [email protected]/java.lang.reflect.Method.invoke(Method.java:568) ~[com.romankudryashov.outboxinbox.userservice.UserServiceApplicationKt:na]
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343) ~[na:na]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196) ~[com.romankudryashov.outboxinbox.userservice.UserServiceApplicationKt:6.0.10]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[com.romankudryashov.outboxinbox.userservice.UserServiceApplicationKt:6.0.10]
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:756) ~[na:na]
        at net.javacrumbs.shedlock.core.DefaultLockingTaskExecutor.executeWithLock(DefaultLockingTaskExecutor.java:71) ~[na:na]
        at net.javacrumbs.shedlock.spring.aop.MethodProxyScheduledLockAdvisor$LockingInterceptor.invoke(MethodProxyScheduledLockAdvisor.java:83) ~[na:na]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[com.romankudryashov.outboxinbox.userservice.UserServiceApplicationKt:6.0.10]
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:756) ~[na:na]
        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708) ~[na:na]
        at com.romankudryashov.outboxinbox.userservice.task.InboxProcessingTask$$SpringCGLIB$$0.execute(<generated>) ~[com.romankudryashov.outboxinbox.userservice.UserServiceApplicationKt:na]
        at [email protected]/java.lang.reflect.Method.invoke(Method.java:568) ~[com.romankudryashov.outboxinbox.userservice.UserServiceApplicationKt:na]
        at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84) ~[na:na]
        at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[com.romankudryashov.outboxinbox.userservice.UserServiceApplicationKt:6.0.10]
        at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:96) ~[na:na]
        at [email protected]/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[na:na]
        at [email protected]/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[com.romankudryashov.outboxinbox.userservice.UserServiceApplicationKt:na]
        at [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[na:na]
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[com.romankudryashov.outboxinbox.userservice.UserServiceApplicationKt:na]
        at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[na:na]
        at [email protected]/java.lang.Thread.run(Thread.java:833) ~[com.romankudryashov.outboxinbox.userservice.UserServiceApplicationKt:na]
        at com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775) ~[com.romankudryashov.outboxinbox.userservice.UserServiceApplicationKt:na]
        at com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:203) ~[na:na]

System Info (please complete the following information):

  • Spring Boot: 3.1.1
  • OS: host: Windows, container: Linux
  • Docker image is built with buildpacks
  • Plugin version: org.graalvm.buildtools.native:0.9.23
@rkudryashov
Copy link
Author

@wilkinsona please let me know is this right repository for this issue?

@wilkinsona
Copy link
Contributor

I think this is caused by some missing configuration in your build. You need to apply the org.hibernate.orm plugin and configure it:

hibernate {
  enhancement {
    lazyInitialization true
    dirtyTracking true
    associationManagement true
  }
}

The above is the Groovy DSL. start.spring.io does not generate this configuration as there was a bug in Hibernate's plugin that stopped it from working with Kotlin. This has now been fixed so I've opened spring-io/start.spring.io#1229.

@rkudryashov
Copy link
Author

Reopen this because I have the same error even after configuration of org.hibernate.orm Gradle Plugin:

sb-repro     | 2023-07-01T08:51:50.000Z ERROR 1 --- [   scheduling-1] o.s.s.s.TaskUtils$LoggingErrorHandler    : Unexpected error occurred in scheduled task
sb-repro     |
sb-repro     | com.oracle.svm.core.jdk.UnsupportedFeatureError: Proxy class defined by interfaces [interface org.hibernate.query.hql.spi.SqmQueryImplementor, interface org.hibernate.query.sqm.internal.SqmInterpretationsKey$InterpretationsKeySource, interface org.hibernate.query.spi.DomainQueryExecutionContext, 
interface org.hibernate.query.SelectionQuery, interface org.hibernate.query.CommonQueryContract] not found. Generating proxy classes at runtime is not supported. Proxy classes need to be defined at image build time by specifying the list of interfaces that they implement. To define proxy classes use -H:DynamicProxyConfigurationFiles=<comma-separated-config-files> and -H:DynamicProxyConfigurationResources=<comma-separated-config-resources> options.
sb-repro     |  at com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:89) ~[na:na]
sb-repro     |  at com.oracle.svm.core.reflect.proxy.DynamicProxySupport.getProxyClass(DynamicProxySupport.java:171) ~[na:na]
sb-repro     |  at [email protected]/java.lang.reflect.Proxy.getProxyConstructor(Proxy.java:47) ~[com.romankudryashov.sbrepro.SbReproKt:na]
sb-repro     |  at [email protected]/java.lang.reflect.Proxy.newProxyInstance(Proxy.java:1037) ~[com.romankudryashov.sbrepro.SbReproKt:na]
sb-repro     |  at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:316) ~[na:na]
sb-repro     |  at jdk.proxy4/jdk.proxy4.$Proxy52.createQuery(Unknown Source) ~[na:na]
sb-repro     |  at org.springframework.data.jpa.repository.query.PartTreeJpaQuery$QueryPreparer.createQuery(PartTreeJpaQuery.java:297) ~[com.romankudryashov.sbrepro.SbReproKt:3.1.1]
sb-repro     |  at org.springframework.data.jpa.repository.query.PartTreeJpaQuery$QueryPreparer.createQuery(PartTreeJpaQuery.java:242) ~[com.romankudryashov.sbrepro.SbReproKt:3.1.1]
sb-repro     |  at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.doCreateQuery(PartTreeJpaQuery.java:113) ~[na:na]
sb-repro     |  at org.springframework.data.jpa.repository.query.AbstractJpaQuery.createQuery(AbstractJpaQuery.java:234) ~[com.romankudryashov.sbrepro.SbReproKt:3.1.1]
sb-repro     |  at org.springframework.data.jpa.repository.query.JpaQueryExecution$CollectionExecution.doExecute(JpaQueryExecution.java:129) ~[na:na]
sb-repro     |  at org.springframework.data.jpa.repository.query.JpaQueryExecution.execute(JpaQueryExecution.java:92) ~[com.romankudryashov.sbrepro.SbReproKt:3.1.1]
sb-repro     |  at org.springframework.data.jpa.repository.query.AbstractJpaQuery.doExecute(AbstractJpaQuery.java:148) ~[com.romankudryashov.sbrepro.SbReproKt:3.1.1]
sb-repro     |  at org.springframework.data.jpa.repository.query.AbstractJpaQuery.execute(AbstractJpaQuery.java:136) ~[com.romankudryashov.sbrepro.SbReproKt:3.1.1]
sb-repro     |  at org.springframework.data.repository.core.support.RepositoryMethodInvoker.doInvoke(RepositoryMethodInvoker.java:136) ~[com.romankudryashov.sbrepro.SbReproKt:3.1.1]
sb-repro     |  at org.springframework.data.repository.core.support.RepositoryMethodInvoker.invoke(RepositoryMethodInvoker.java:120) ~[com.romankudryashov.sbrepro.SbReproKt:3.1.1]
sb-repro     |  at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.doInvoke(QueryExecutorMethodInterceptor.java:164) ~[na:na]
sb-repro     |  at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.invoke(QueryExecutorMethodInterceptor.java:143) ~[na:na]
sb-repro     |  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[com.romankudryashov.sbrepro.SbReproKt:6.0.10]
sb-repro     |  at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:72) ~[na:na]
sb-repro     |  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[com.romankudryashov.sbrepro.SbReproKt:6.0.10]
sb-repro     |  at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) ~[na:na]
sb-repro     |  at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:391) ~[com.romankudryashov.sbrepro.SbReproKt:6.0.10]
sb-repro     |  at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) ~[com.romankudryashov.sbrepro.SbReproKt:6.0.10]
sb-repro     |  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[com.romankudryashov.sbrepro.SbReproKt:6.0.10]
sb-repro     |  at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:137) ~[na:na]
sb-repro     |  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[com.romankudryashov.sbrepro.SbReproKt:6.0.10]
sb-repro     |  at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:135) ~[na:na]
sb-repro     |  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[com.romankudryashov.sbrepro.SbReproKt:6.0.10]
sb-repro     |  at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) ~[na:na]
sb-repro     |  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[com.romankudryashov.sbrepro.SbReproKt:6.0.10]
sb-repro     |  at org.springframework.data.repository.core.support.MethodInvocationValidator.invoke(MethodInvocationValidator.java:94) ~[na:na]
sb-repro     |  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[com.romankudryashov.sbrepro.SbReproKt:6.0.10]
sb-repro     |  at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:244) ~[na:na]
sb-repro     |  at jdk.proxy4/jdk.proxy4.$Proxy49.findFirst50ByStatusOrderByCreatedAtAsc(Unknown Source) ~[na:na]
sb-repro     |  at com.romankudryashov.sbrepro.task.InboxProcessingTask.execute(InboxProcessingTask.kt:20) ~[com.romankudryashov.sbrepro.SbReproKt:na]
sb-repro     |  at [email protected]/java.lang.reflect.Method.invoke(Method.java:568) ~[com.romankudryashov.sbrepro.SbReproKt:na]
sb-repro     |  at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84) ~[na:na]
sb-repro     |  at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[com.romankudryashov.sbrepro.SbReproKt:6.0.10]
sb-repro     |  at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:96) ~[na:na]
sb-repro     |  at [email protected]/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[na:na]
sb-repro     |  at [email protected]/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[com.romankudryashov.sbrepro.SbReproKt:na]
sb-repro     |  at [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[na:na]
sb-repro     |  at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[com.romankudryashov.sbrepro.SbReproKt:na]
sb-repro     |  at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[na:na]
sb-repro     |  at [email protected]/java.lang.Thread.run(Thread.java:833) ~[com.romankudryashov.sbrepro.SbReproKt:na]
sb-repro     |  at com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775) ~[com.romankudryashov.sbrepro.SbReproKt:na]
sb-repro     |  at com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:203) ~[na:na]
sb-repro     |

Not sure if this the right repository. Probably someone can suggest more appropriate one.

@rkudryashov rkudryashov reopened this Jul 1, 2023
@rkudryashov
Copy link
Author

The issue looks similar to spring-projects/spring-framework#29603

@derkoe
Copy link
Contributor

derkoe commented Jul 4, 2023

I have the same issue - here is the repo with the update porscheinformatik/angular-spring-heroes#339

Hibernate with Spring Boot 3.1.0 and 3.1.1 does not work.

@derkoe
Copy link
Contributor

derkoe commented Jul 4, 2023

Added a smoke test that currently fails because of this issue: spring-projects/spring-aot-smoke-tests#183

@wilkinsona
Copy link
Contributor

@derkoe Are you sure you have the same issue? @rkudryashov is not using InitializingBean.

@derkoe
Copy link
Contributor

derkoe commented Jul 7, 2023

@wilkinsona it's the same exception and @rkudryashov is using @scheduled - seems like this is triggered by things called from background

@derkoe
Copy link
Contributor

derkoe commented Jul 7, 2023

InitializingBean was easier to test than @Scheduled

@wilkinsona
Copy link
Contributor

I see it's the same exception but I don't think it's certain that it's the same problem.

seems like this is triggered by things called from background

afterPropertiesSet isn't called in the background. It's called on the main thread as part of application startup.

@derkoe
Copy link
Contributor

derkoe commented Jul 7, 2023

@wilkinsona okay where should I create the issue with InitializingBean? In Spring Framework? Or Spring Data? Or here?

Also: I'm not sure why those Hibernate issues do not arise with Quarkus - they're using the same version.

@wilkinsona
Copy link
Contributor

I'm not sure yet. I've asked the Spring Data team to take a look.

@christophstrobl
Copy link
Contributor

Turns out the hibernate metadata for 6.1.1 contains a proxy configuration holding the very definition that is now missing.
Unfortunately the metadata for 6.2.0 does not contain any proxy configuration at all, which is likely causing the error.

@wilkinsona
Copy link
Contributor

Thanks for tracking that down, @christophstrobl. Did you manage to determine why the behaviour differs in afterPropertiesSet or a @Scheduled method vs a CommandLineRunner?

@christophstrobl
Copy link
Contributor

@wilkinsona unfortunately not. Also talked to @mp911de.

@rkudryashov
Copy link
Author

I'm going to close this because after update to Spring Boot 3.2.0-M2 the issue is not reproduced (you can check https://github.com/rkudryashov/sb-repro)

@rkudryashov rkudryashov closed this as not planned Won't fix, can't repro, duplicate, stale Aug 25, 2023
@itineric
Copy link

That is still a bug when using spring boot 3.1.3+.
The proxy-config is missing for hibernate 6.2.0.

Forcing build to use version 6.1.1 of hibernate metadata gives another error: org.hibernate.boot.model.relational.ColumnOrderingStrategyStandard

And it is not possible to force using both 6.2.0 and 6.1.1 version of metadata.

@derkoe
Copy link
Contributor

derkoe commented Sep 18, 2023

Yes, all JPA/Hibernate operations running from @Scheduled and any initializing methods do not with Spring Boot 3.1.x.

The smoke-test is also not merged (yet): spring-projects/spring-aot-smoke-tests#183

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants