spring-projects / spring-data-jpa

Simplifies the development of creating a JPA-based data access layer.
https://spring.io/projects/spring-data-jpa/
Apache License 2.0
3.03k stars 1.42k forks source link

nosuchelementexception in query while upgrading hibernate from 6.4 to 6.5 for h2 database #3659

Closed SwapnaAnchuri closed 3 weeks ago

SwapnaAnchuri commented 3 weeks ago

We are using h2 database and for one of the query validation failed and getting below error while upgrading hibernate from 6.4 to 6.5

at app//org.hibernate.query.hql.internal.StandardHqlTranslator.translate(StandardHqlTranslator.java:95) at app//org.hibernate.query.internal.QueryInterpretationCacheStandardImpl.createHqlInterpretation(QueryInterpretationCacheStandardImpl.java:145) at app//org.hibernate.query.internal.QueryInterpretationCacheStandardImpl.resolveHqlInterpretation(QueryInterpretationCacheStandardImpl.java:132) at app//org.hibernate.internal.AbstractSharedSessionContract.interpretHql(AbstractSharedSessionContract.java:802) at app//org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:852) at app//org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:765) at app//org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:140) at jdk.internal.reflect.GeneratedMethodAccessor214.invoke(Unknown Source) at java.base@17.0.4/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base@17.0.4/java.lang.reflect.Method.invoke(Method.java:568) at app//org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:364) at app/jdk.proxy3/jdk.proxy3.$Proxy225.createQuery(Unknown Source) at app//org.springframework.data.jpa.repository.query.SimpleJpaQuery.validateQuery(SimpleJpaQuery.java:94) ... 140 more Caused by: java.util.NoSuchElementException at org.hibernate.internal.util.collections.StandardStack.pop(StandardStack.java:60) at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitSelectStatement(SemanticQueryBuilder.java:493) at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitStatement(SemanticQueryBuilder.java:449) at org.hibernate.query.hql.internal.SemanticQueryBuilder.buildSemanticModel(SemanticQueryBuilder.java:322) at org.hibernate.query.hql.internal.StandardHqlTranslator.translate(StandardHqlTranslator.java:71) ... 152 more

christophstrobl commented 3 weeks ago

From the information provided this seems to be an issue with the underlying persistence provider. Please report it in the hibernate bug tracker