-
Notifications
You must be signed in to change notification settings - Fork 103
Not planned
Labels
bugSomething isn't workingSomething isn't working
Description
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 java.base@17.0.7/java.lang.reflect.Proxy.getProxyConstructor(Proxy.java:47) ~[com.romankudryashov.outboxinbox.userservice.UserServiceApplicationKt:na]
at java.base@17.0.7/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 java.base@17.0.7/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 java.base@17.0.7/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 java.base@17.0.7/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[na:na]
at java.base@17.0.7/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[com.romankudryashov.outboxinbox.userservice.UserServiceApplicationKt:na]
at java.base@17.0.7/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[na:na]
at java.base@17.0.7/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[com.romankudryashov.outboxinbox.userservice.UserServiceApplicationKt:na]
at java.base@17.0.7/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[na:na]
at java.base@17.0.7/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
jdonzallaz
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
rkudryashov commentedon Jun 24, 2023
@wilkinsona please let me know is this right repository for this issue?
wilkinsona commentedon Jun 24, 2023
I think this is caused by some missing configuration in your build. You need to apply the
org.hibernate.orm
plugin and configure it: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 commentedon Jul 1, 2023
Reopen this because I have the same error even after configuration of
org.hibernate.orm
Gradle Plugin:Not sure if this the right repository. Probably someone can suggest more appropriate one.
rkudryashov commentedon Jul 3, 2023
The issue looks similar to spring-projects/spring-framework#29603
derkoe commentedon 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.
Smoke test for issue with JPA call from init method
derkoe commentedon Jul 4, 2023
Added a smoke test that currently fails because of this issue: spring-projects/spring-aot-smoke-tests#183
wilkinsona commentedon Jul 7, 2023
@derkoe Are you sure you have the same issue? @rkudryashov is not using
InitializingBean
.15 remaining items