|
| 1 | +# Spring Boot / Spring Data JPA Query Method Issue |
| 2 | + |
| 3 | +The modules `spring-boot-3.1.1` and `spring-boot-3.1.2` contain test applications which are identical except for the Spring Boot / Spring Data JPA versions. |
| 4 | + |
| 5 | +[`BaseArticleRepositoryCustomImpl.java`](spring-boot-3.1.1/src/main/java/org/devopsix/springdatajpa/BaseArticleRepositoryCustomImpl.java) contains a method utilizing JPA Criteria API for loading entities. |
| 6 | +In [`BaseArticleRepositoryTest.java`](spring-boot-3.1.1/src/test/java/org/devopsix/springdatajpa/BaseArticleRepositoryTest.java) this method is invoked. |
| 7 | + |
| 8 | +## Spring Boot 3.1.1 (Spring Data JPA 3.1.1) |
| 9 | + |
| 10 | +``` |
| 11 | +mvn -f spring-boot-3.1.1/pom.xml verify |
| 12 | +``` |
| 13 | + |
| 14 | +Build succeeds. |
| 15 | + |
| 16 | +## Spring Boot 3.1.2 (Spring Data JPA 3.1.2) |
| 17 | + |
| 18 | +``` |
| 19 | +mvn -f spring-boot-3.1.2/pom.xml verify |
| 20 | +``` |
| 21 | + |
| 22 | +Build fails for a test failure due to this exception: |
| 23 | + |
| 24 | +``` |
| 25 | +java.lang.AssertionError |
| 26 | + at org.hibernate.query.sqm.tree.domain.AbstractSqmPath.copyTo(AbstractSqmPath.java:61) |
| 27 | + at org.hibernate.query.sqm.tree.domain.SqmEntityValuedSimplePath.copy(SqmEntityValuedSimplePath.java:47) |
| 28 | + at org.hibernate.query.sqm.tree.domain.SqmEntityValuedSimplePath.copy(SqmEntityValuedSimplePath.java:21) |
| 29 | + at org.hibernate.query.sqm.tree.domain.AbstractSqmPath.copyTo(AbstractSqmPath.java:67) |
| 30 | + at org.hibernate.query.sqm.tree.domain.AbstractSqmFrom.copyTo(AbstractSqmFrom.java:130) |
| 31 | + at org.hibernate.query.sqm.tree.domain.AbstractSqmQualifiedJoin.copyTo(AbstractSqmQualifiedJoin.java:39) |
| 32 | + at org.hibernate.query.sqm.tree.domain.SqmSetJoin.copy(SqmSetJoin.java:74) |
| 33 | + at org.hibernate.query.sqm.tree.domain.SqmSetJoin.copy(SqmSetJoin.java:32) |
| 34 | + at org.hibernate.query.sqm.tree.domain.AbstractSqmFrom.copyTo(AbstractSqmFrom.java:134) |
| 35 | + at org.hibernate.query.sqm.tree.from.SqmRoot.copyTo(SqmRoot.java:93) |
| 36 | + at org.hibernate.query.sqm.tree.from.SqmRoot.copy(SqmRoot.java:87) |
| 37 | + at org.hibernate.query.sqm.tree.from.SqmFromClause.<init>(SqmFromClause.java:40) |
| 38 | + at org.hibernate.query.sqm.tree.from.SqmFromClause.copy(SqmFromClause.java:46) |
| 39 | + at org.hibernate.query.sqm.tree.select.SqmQuerySpec.copy(SqmQuerySpec.java:101) |
| 40 | + at org.hibernate.query.sqm.tree.select.SqmQuerySpec.copy(SqmQuerySpec.java:56) |
| 41 | + at org.hibernate.query.sqm.tree.select.SqmSelectStatement.copy(SqmSelectStatement.java:131) |
| 42 | + at org.hibernate.query.sqm.tree.select.SqmSelectStatement.copy(SqmSelectStatement.java:42) |
| 43 | + at org.hibernate.query.sqm.internal.QuerySqmImpl.<init>(QuerySqmImpl.java:226) |
| 44 | + at org.hibernate.internal.AbstractSharedSessionContract.createCriteriaQuery(AbstractSharedSessionContract.java:1343) |
| 45 | + at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:1304) |
| 46 | + at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:120) |
| 47 | + at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) |
| 48 | + at java.base/java.lang.reflect.Method.invoke(Method.java:577) |
| 49 | + at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:311) |
| 50 | + at jdk.proxy2/jdk.proxy2.$Proxy103.createQuery(Unknown Source) |
| 51 | + at org.devopsix.springdatajpa.BaseArticleRepositoryCustomImpl.search(BaseArticleRepositoryCustomImpl.java:30) |
| 52 | + at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) |
| 53 | + at java.base/java.lang.reflect.Method.invoke(Method.java:577) |
| 54 | + at org.springframework.data.repository.core.support.RepositoryMethodInvoker$RepositoryFragmentMethodInvoker.lambda$new$0(RepositoryMethodInvoker.java:288) |
| 55 | + at org.springframework.data.repository.core.support.RepositoryMethodInvoker.doInvoke(RepositoryMethodInvoker.java:136) |
| 56 | + at org.springframework.data.repository.core.support.RepositoryMethodInvoker.invoke(RepositoryMethodInvoker.java:120) |
| 57 | + at org.springframework.data.repository.core.support.RepositoryComposition$RepositoryFragments.invoke(RepositoryComposition.java:516) |
| 58 | + at org.springframework.data.repository.core.support.RepositoryComposition.invoke(RepositoryComposition.java:285) |
| 59 | + at org.springframework.data.repository.core.support.RepositoryFactorySupport$ImplementationMethodExecutionInterceptor.invoke(RepositoryFactorySupport.java:628) |
| 60 | + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) |
| 61 | + at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.doInvoke(QueryExecutorMethodInterceptor.java:168) |
| 62 | + at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.invoke(QueryExecutorMethodInterceptor.java:143) |
| 63 | + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) |
| 64 | + at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) |
| 65 | + at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:391) |
| 66 | + at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) |
| 67 | + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) |
| 68 | + at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:137) |
| 69 | + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) |
| 70 | + at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:164) |
| 71 | + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) |
| 72 | + at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) |
| 73 | + at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) |
| 74 | + at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:244) |
| 75 | + at jdk.proxy2/jdk.proxy2.$Proxy110.search(Unknown Source) |
| 76 | + at org.devopsix.springdatajpa.BaseArticleRepositoryTest.test(BaseArticleRepositoryTest.java:15) |
| 77 | + at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) |
| 78 | + at java.base/java.lang.reflect.Method.invoke(Method.java:577) |
| 79 | + at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:727) |
| 80 | + at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60) |
| 81 | + at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131) |
| 82 | + at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:156) |
| 83 | + at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:147) |
| 84 | + at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:86) |
| 85 | + at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(InterceptingExecutableInvoker.java:103) |
| 86 | + at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(InterceptingExecutableInvoker.java:93) |
| 87 | + at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106) |
| 88 | + at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64) |
| 89 | + at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45) |
| 90 | + at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37) |
| 91 | + at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:92) |
| 92 | + at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:86) |
| 93 | + at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:217) |
| 94 | + at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) |
| 95 | + at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:213) |
| 96 | + at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:138) |
| 97 | + at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:68) |
| 98 | + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151) |
| 99 | + at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) |
| 100 | + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) |
| 101 | + at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) |
| 102 | + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) |
| 103 | + at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) |
| 104 | + at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) |
| 105 | + at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) |
| 106 | + at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) |
| 107 | + at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41) |
| 108 | + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155) |
| 109 | + at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) |
| 110 | + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) |
| 111 | + at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) |
| 112 | + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) |
| 113 | + at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) |
| 114 | + at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) |
| 115 | + at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) |
| 116 | + at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) |
| 117 | + at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41) |
| 118 | + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155) |
| 119 | + at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) |
| 120 | + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) |
| 121 | + at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) |
| 122 | + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) |
| 123 | + at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) |
| 124 | + at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) |
| 125 | + at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) |
| 126 | + at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35) |
| 127 | + at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57) |
| 128 | + at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54) |
| 129 | + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:147) |
| 130 | + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:127) |
| 131 | + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:90) |
| 132 | + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:55) |
| 133 | + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:102) |
| 134 | + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:54) |
| 135 | + at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114) |
| 136 | + at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86) |
| 137 | + at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86) |
| 138 | + at org.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:50) |
| 139 | + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184) |
| 140 | + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148) |
| 141 | + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122) |
| 142 | + at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385) |
| 143 | + at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) |
| 144 | + at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507) |
| 145 | + at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495) |
| 146 | +``` |
0 commit comments