Adrian Gologan (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=712020%...
) *updated* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZDExZjhlZjBk...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16863?atlOrigin=eyJpIjoiZDExZj...
) HHH-16863 (
https://hibernate.atlassian.net/browse/HHH-16863?atlOrigin=eyJpIjoiZDExZj...
) org.hibernate.sql.ast.SqlTreeCreationException: Could not locate TableGroup (
https://hibernate.atlassian.net/browse/HHH-16863?atlOrigin=eyJpIjoiZDExZj...
)
Change By: Adrian Gologan (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=712020%...
)
I have a spring boot 2.7.5 with hibernate 5.6.12 project and I wanted to upgrade to spring
boot 3.1.0 with hibernate 6.6.2
I'm trying a query count in database for getting total number of records in database
an I get the error
*org.hibernate.sql.ast.SqlTreeCreationException: Could not locate TableGroup -
model.dao.User(1057834329991800)*
*at
org.hibernate.query.sqm.sql.BaseSqmToSqlAstConverter.prepareReusablePath(BaseSqmToSqlAstConverter.java:3349)
~[hibernate-core-6.2.2.Final.jar:6.2.2.Final]*
Base class is:
{noformat}public class JPADaoImpl {
protected final Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
@Qualifier("dataSource")
protected DataSource dataSource;
@PersistenceContext
protected EntityManager entityManager;
protected <T> PageData<T> getPageData(CriteriaQuery<T>
criteria,Root<T> root,Integer pStart, Integer pSize,LockModeType lockModeType)
throws Exception{
PageData<T> pageData =null;
try {
pageData = new PageData<T>();
criteria.distinct(true);
criteria.select(root);
TypedQuery<T> query = getPersistenceQuery(criteria, pStart, pSize, lockModeType);
if (pStart == null || pSize == null) {
pageData.setData(query.getResultList());
return pageData;
}
pageData.setpStart(pStart);
pageData.setpSize(pSize);
Long rowCount = getRowCount(criteria,root,true);
pageData.setTotalNo(rowCount);
pageData.setpCount(rowCount / pSize + (rowCount % pSize == 0 ? 0 : 1));
pageData.setData(query.getResultList());
return pageData;
} catch (Exception e) {
throw e;
}
}
/**
*
* @param criteria
* @param root
* @param distinct
* @return
* @throws Exception
*/
protected <T> Long getRowCount(CriteriaQuery<T> criteria,Root<T>
root,boolean distinct) throws Exception {
Long rowcount=null;
CriteriaBuilder builder = entityManager.getCriteriaBuilder();
CriteriaQuery<Long> countCriteria=builder.createQuery(Long.class);
Root<?> entityRoot = countCriteria.from(root.getJavaType());
entityRoot.alias(root.getAlias());
doJoins(root.getJoins(),entityRoot);
if( criteria.isDistinct()){
countCriteria.select(builder.countDistinct(entityRoot));
}else{
countCriteria.select(builder.count(entityRoot));
}
Predicate groupRestriction = criteria.getGroupRestriction();
Predicate fromRestriction = criteria.getRestriction();
if ( groupRestriction != null) {
countCriteria.having(groupRestriction);
}
if ( fromRestriction != null) {
countCriteria.where(fromRestriction);
}
countCriteria. groupBy(criteria.getGroupList());
countCriteria. distinct(criteria.isDistinct());
rowcount=entityManager.createQuery(countCriteria).getSingleResult();
return rowcount;
}
/**
*
* @param joins
* @param root_
*/
private void doJoins(Set<? extends Join<?, ?>> joins,Join<?,?> root_){
for(Join<?,?> join: joins){
Join<?,?> joined = root_.join(join.getAttribute().getName(),join.getJoinType());
doJoins(join.getJoins(),joined);
}
}
/**
*
* @param joins
* @param root_
*/
private void doJoins(Set<? extends Join<?, ?>> joins,Root<?> root_){
for(Join<?,?> join: joins){
Join<?,?> joined = root_.join(join.getAttribute().getName(),join.getJoinType());
doJoins(join.getJoins(), joined);
}
}
/**
* @param criteria
* @param pStart
* @param pSize
* @param lockModeType
* @return
*/
private <T> TypedQuery<T> getPersistenceQuery(CriteriaQuery<T> criteria,
Integer pStart, Integer pSize, LockModeType lockModeType) {
TypedQuery<T> query = entityManager.createQuery(criteria);
if(lockModeType!=null){
query.setLockMode(lockModeType);
}
if (pStart != null && pSize != null) {
query.setFirstResult((pStart - 1) * pSize);
query.setMaxResults(pSize);
}
return query;
}
}{noformat}
and the class that extends it
{noformat}public class UserDaoImpl extends JPADaoImpl implements UserDao{
@Override
public PageData<User> list(User filter, Integer pStart, Integer pSize,
List<Order> order, User userAuth) throws Exception {
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
CriteriaQuery<User> criteria = criteriaBuilder.createQuery(User.class);
Root<User> root = criteria.from(User.class);
root.alias("root");
criteria.select(root);
List<Predicate> predicateList = null;
if (filter!=null){
predicateList = new ArrayList<Predicate>();
if (!Utils.isEmpty(filter.getStatus())) {
predicateList.add(criteriaBuilder.and(criteriaBuilder.equal(root.<Byte>get("status"),filter.getStatus())));
}
}
if(!Utils.isEmpty(predicateList)){
criteria.where(criteriaBuilder.and(predicateList.toArray(new
Predicate[predicateList.size()])));
}
criteria.orderBy(criteriaBuilder.asc(root.get("last_name")),criteriaBuilder.asc(root.get("first_name")));
PageData<User> pageData;
pageData = getPageData(criteria,root, pStart, pSize);
return pageData;
}
}{noformat}
in UserDaoImpl.list method, JPADaoImpl.getRowCount at line
rowcount=entityManager.createQuery(countCriteria).getSingleResult();
I get the error
*org.hibernate.sql.ast.SqlTreeCreationException: Could not locate TableGroup -
ro.fiveplus.psychology. model.dao.User( 1057834329991800 1222042499000100 )*
*at org.hibernate.query.sqm.sql.BaseSqmToSqlAstConverter.prepareReusablePath( **
BaseSqmToSqlAstConverter.java: 3349 3615** ) ~[hibernate-core-6.2. 5.Final.jar:6. 2. 5.
Final ]*
*at org.
hibernate.query.sqm.sql.BaseSqmToSqlAstConverter.prepareReusablePath(**BaseSqmToSqlAstConverter.java:3562**)
~[hibernate-core-6.2.5.Final. jar:6.2. 5.Final]*
*at
org.hibernate.query.sqm.sql.BaseSqmToSqlAstConverter.prepareReusablePath(**BaseSqmToSqlAstConverter.java:3551**)
~[hibernate-core-6. 2. 5. Final.jar:6.2.5.Final ]*
*at
org.hibernate.query.sqm.sql.BaseSqmToSqlAstConverter.visitBasicValuedPath(**BaseSqmToSqlAstConverter.java:4169**)
~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]*
*at
org.hibernate.query.sqm.sql.BaseSqmToSqlAstConverter.visitBasicValuedPath(**BaseSqmToSqlAstConverter.java:434**)
~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]*
*at
org.hibernate.query.sqm.tree.domain.SqmBasicValuedSimplePath.accept(**SqmBasicValuedSimplePath.java:132**)
~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]*
*at
org.hibernate.query.sqm.sql.BaseSqmToSqlAstConverter.visitComparisonPredicate(**BaseSqmToSqlAstConverter.java:7307**)
~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]*
*at
org.hibernate.query.sqm.sql.BaseSqmToSqlAstConverter.visitComparisonPredicate(**BaseSqmToSqlAstConverter.java:434**)
~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]*
*at
org.hibernate.query.sqm.tree.predicate.SqmComparisonPredicate.accept(**SqmComparisonPredicate.java:104**)
~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]*
*at
org.hibernate.query.sqm.sql.BaseSqmToSqlAstConverter.visitJunctionPredicate(**BaseSqmToSqlAstConverter.java:6967**)
~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]*
*at
org.hibernate.query.sqm.sql.BaseSqmToSqlAstConverter.visitJunctionPredicate(**BaseSqmToSqlAstConverter.java:434**)
~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]*
*at
org.hibernate.query.sqm.tree.predicate.SqmJunctionPredicate.accept(**SqmJunctionPredicate.java:74**)
~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]*
*at
org.hibernate.query.sqm.sql.BaseSqmToSqlAstConverter.visitJunctionPredicate(**BaseSqmToSqlAstConverter.java:6967**)
~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]*
*at
org.hibernate.query.sqm.sql.BaseSqmToSqlAstConverter.visitJunctionPredicate(**BaseSqmToSqlAstConverter.java:434**)
~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]*
*at
org.hibernate.query.sqm.tree.predicate.SqmJunctionPredicate.accept(**SqmJunctionPredicate.java:74**)
~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]*
*at
org.hibernate.query.sqm.sql.BaseSqmToSqlAstConverter.visitWhereClause(**BaseSqmToSqlAstConverter.java:2476**)
~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]*
*at
org.hibernate.query.sqm.sql.BaseSqmToSqlAstConverter.visitQuerySpec(**BaseSqmToSqlAstConverter.java:2053**)
~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]*
*at
org.hibernate.query.sqm.sql.BaseSqmToSqlAstConverter.visitQuerySpec(**BaseSqmToSqlAstConverter.java:434**)
~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]*
*at org.hibernate.query.sqm.tree.select.SqmQuerySpec.accept(**SqmQuerySpec.java:125**)
~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]*
*at
org.hibernate.query.sqm.spi.BaseSemanticQueryWalker.visitQueryPart(**BaseSemanticQueryWalker.java:221**)
~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]*
*at
org.hibernate.query.sqm.sql.BaseSqmToSqlAstConverter.visitQueryPart(**BaseSqmToSqlAstConverter.java:1907**)
~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]*
*at
org.hibernate.query.sqm.sql.BaseSqmToSqlAstConverter.visitSelectStatement(**BaseSqmToSqlAstConverter.java:1592**)
~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]*
*at
org.hibernate.query.sqm.sql.BaseSqmToSqlAstConverter.visitSelectStatement(**BaseSqmToSqlAstConverter.java:434**)
~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]*
*at
org.hibernate.query.sqm.tree.select.SqmSelectStatement.accept(**SqmSelectStatement.java:222**)
~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]*
*at
org.hibernate.query.sqm.sql.BaseSqmToSqlAstConverter.translate(**BaseSqmToSqlAstConverter.java:775**)
~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]*
*at
org.hibernate.query.sqm.internal.ConcreteSqmSelectQueryPlan.buildCacheableSqmInterpretation(**ConcreteSqmSelectQueryPlan.java:345**)
~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]*
*at
org.hibernate.query.sqm.internal.ConcreteSqmSelectQueryPlan.withCacheableSqmInterpretation(**ConcreteSqmSelectQueryPlan.java:268**)
~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]*
*at
org.hibernate.query.sqm.internal.ConcreteSqmSelectQueryPlan.performList(**ConcreteSqmSelectQueryPlan.java:244**)
~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]*
*at org.hibernate.query.sqm.internal.QuerySqmImpl.doList(**QuerySqmImpl.java:518**)
~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]*
*at
org.hibernate.query.spi.AbstractSelectionQuery.list(**AbstractSelectionQuery.java:367**)
~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]*
*at
org.hibernate.query.spi.AbstractSelectionQuery.getSingleResult(**AbstractSelectionQuery.java:473**)
~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]*
*at ro.fiveplus.psychology.dao.impl.JPADaoImpl.getRowCount(**JPADaoImpl.java:179**)
~[classes/:0.0.1-SNAPSHOT]*
*at ro.fiveplus.psychology.dao.impl.JPADaoImpl.getPageData(**JPADaoImpl.java:74**)
~[classes/:0.0.1-SNAPSHOT]*
*at ro.fiveplus.psychology.dao.impl.JPADaoImpl.getPageData(**JPADaoImpl.java:139**)
~[classes/:0.0.1-SNAPSHOT]*
*at ro.fiveplus.psychology.dao.impl.UserDaoImpl.list(**UserDaoImpl.java:148**)
~[classes/:0.0.1-SNAPSHOT]*
*at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(**Native Method**)
~[na:na]*
*at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(**NativeMethodAccessorImpl.java:77**)
~[na:na]*
*at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(**DelegatingMethodAccessorImpl.java:43**)
~[na:na]*
*at java.base/java.lang.reflect.Method.invoke(**Method.java:568**) ~[na:na]*
*at
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(**AopUtils.java:343**)
~[spring-aop-6.0.10.jar:6.0.10]*
*at
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(**ReflectiveMethodInvocation.java:196**)
~[spring-aop-6.0.10.jar:6.0.10]*
*at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(**ReflectiveMethodInvocation.java:163**)
~[spring-aop-6.0.10.jar:6.0.10]*
*at
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(**CglibAopProxy.java:756**)
~[spring-aop-6.0.10.jar:6.0.10]*
*at
org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(**PersistenceExceptionTranslationInterceptor.java:137**)
~[spring-tx-6.0.10.jar:6.0.10]*
*at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(**ReflectiveMethodInvocation.java:184**)
~[spring-aop-6.0.10.jar:6.0.10]*
*at
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(**CglibAopProxy.java:756**)
~[spring-aop-6.0.10.jar:6.0.10]*
*at
org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(**CglibAopProxy.java:708**)
~[spring-aop-6.0.10.jar:6.0.10]*
*at ro.fiveplus.psychology.dao.impl.UserDaoImpl$$SpringCGLIB$$0.list(<generated>)
~[classes/:0.0.1-SNAPSHOT]*
*at ro.fiveplus.psychology.service.impl.UserServiceImpl.list(**UserServiceImpl.java:59**)
~[classes/:0.0.1-SNAPSHOT]*
*at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(**Native Method**)
~[na:na]*
*at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(**NativeMethodAccessorImpl.java:77**)
~[na:na]*
*at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(**DelegatingMethodAccessorImpl.java:43**)
~[na:na]*
*at java.base/java.lang.reflect.Method.invoke(**Method.java:568**) ~[na:na]*
*at
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(**AopUtils.java:343**)
~[spring-aop-6.0.10.jar:6.0.10]*
*at
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(**ReflectiveMethodInvocation.java:196**)
~[spring-aop-6.0.10.jar:6.0.10]*
*at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(**ReflectiveMethodInvocation.java:163**)
~[spring-aop-6.0.10.jar:6.0.10]*
*at
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(**CglibAopProxy.java:756**)
~[spring-aop-6.0.10.jar:6.0.10]*
*at
org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(**TransactionInterceptor.java:123**)
~[spring-tx-6.0.10.jar:6.0.10]*
*at
org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(**TransactionAspectSupport.java:391**)
~[spring-tx-6.0.10.jar:6.0.10]*
*at
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(**TransactionInterceptor.java:119**)
~[spring-tx-6.0.10.jar:6.0.10]*
*at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(**ReflectiveMethodInvocation.java:184**)
~[spring-aop-6.0.10.jar:6.0.10]*
*at
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(**CglibAopProxy.java:756**)
~[spring-aop-6.0.10.jar:6.0.10]*
*at
org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(**CglibAopProxy.java:708**)
~[spring-aop-6.0.10.jar:6.0.10]*
*at
ro.fiveplus.psychology.service.impl.UserServiceImpl$$SpringCGLIB$$0.list(<generated>)
~[classes/:0.0.1-SNAPSHOT]*
*at
ro.fiveplus.psychology.controller.admin.UserController.list(**UserController.java:92**)
~[classes/:0.0.1-SNAPSHOT]*
*at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(**Native Method**)
~[na:na]*
*at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(**NativeMethodAccessorImpl.java:77**)
~[na:na]*
*at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(**DelegatingMethodAccessorImpl.java:43**)
~[na:na]*
*at java.base/java.lang.reflect.Method.invoke(**Method.java:568**) ~[na:na]*
*at
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(**AopUtils.java:343**)
~[spring-aop-6.0.10.jar:6.0.10]*
*at
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(**ReflectiveMethodInvocation.java:196**)
~[spring-aop-6.0.10.jar:6.0.10]*
*at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(**ReflectiveMethodInvocation.java:163**)
~[spring-aop-6.0.10.jar:6.0.10]*
*at
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(**CglibAopProxy.java:756**)
~[spring-aop-6.0.10.jar:6.0.10]*
*at
org.springframework.security.authorization.method.AuthorizationManagerBeforeMethodInterceptor.invoke(**AuthorizationManagerBeforeMethodInterceptor.java:199**)
~[spring-security-core-6.1.1.jar:6.1.1]*
*at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(**ReflectiveMethodInvocation.java:184**)
~[spring-aop-6.0.10.jar:6.0.10]*
*at
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(**CglibAopProxy.java:756**)
~[spring-aop-6.0.10.jar:6.0.10]*
*at
org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(**CglibAopProxy.java:708**)
~[spring-aop-6.0.10.jar:6.0.10]*
*at
ro.fiveplus.psychology.controller.admin.UserController$$SpringCGLIB$$0.list(<generated>)
~[classes/:0.0.1-SNAPSHOT]*
*at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(**Native Method**)
~[na:na]*
*at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(**NativeMethodAccessorImpl.java:77**)
~[na:na]*
*at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(**DelegatingMethodAccessorImpl.java:43**)
~[na:na]*
*at java.base/java.lang.reflect.Method.invoke(**Method.java:568**) ~[na:na]*
*at
org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(**InvocableHandlerMethod.java:207**)
~[spring-web-6.0.10.jar:6.0.10]*
*at
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(**InvocableHandlerMethod.java:152**)
~[spring-web-6.0.10.jar:6.0.10]*
*at
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(**ServletInvocableHandlerMethod.java:118**)
~[spring-webmvc-6.0.10.jar:6.0.10]*
*at
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(**RequestMappingHandlerAdapter.java:884**)
~[spring-webmvc-6.0.10.jar:6.0.10]*
*at
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(**RequestMappingHandlerAdapter.java:797**)
~[spring-webmvc-6.0.10.jar:6.0.10]*
*at
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(**AbstractHandlerMethodAdapter.java:87**)
~[spring-webmvc-6.0.10.jar:6.0.10]*
*at
org.springframework.web.servlet.DispatcherServlet.doDispatch(**DispatcherServlet.java:1081**)
~[spring-webmvc-6.0.10.jar:6.0.10]*
*at
org.springframework.web.servlet.DispatcherServlet.doService(**DispatcherServlet.java:974**)
~[spring-webmvc-6.0.10.jar:6.0.10]*
*at
org.springframework.web.servlet.FrameworkServlet.processRequest(**FrameworkServlet.java:1011**)
~[spring-webmvc-6.0.10.jar:6.0.10]*
*at org.springframework.web.servlet.FrameworkServlet.doGet(**FrameworkServlet.java:903**)
~[spring-webmvc-6.0.10.jar:6.0.10]*
*at jakarta.servlet.http.HttpServlet.service(**HttpServlet.java:564**)
~[servlet-api.jar:6.0]*
*at
org.springframework.web.servlet.FrameworkServlet.service(**FrameworkServlet.java:885**)
~[spring-webmvc-6.0.10.jar:6.0.10]*
*at jakarta.servlet.http.HttpServlet.service(**HttpServlet.java:658**)
~[servlet-api.jar:6.0]*
*at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(**ApplicationFilterChain.java:205**)
~[catalina.jar:10.1.8]*
*at
org.apache.catalina.core.ApplicationFilterChain.doFilter(**ApplicationFilterChain.java:149**)
~[catalina.jar:10.1.8]*
*at org.apache.tomcat.websocket.server.WsFilter.doFilter(**WsFilter.java:51**)
~[tomcat-websocket.jar:10.1.8]*
*at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(**ApplicationFilterChain.java:174**)
~[catalina.jar:10.1.8]*
*at
org.apache.catalina.core.ApplicationFilterChain.doFilter(**ApplicationFilterChain.java:149**)
~[catalina.jar:10.1.8]*
*at
org.springframework.web.servlet.resource.ResourceUrlEncodingFilter.doFilter(**ResourceUrlEncodingFilter.java:66**)
~[spring-webmvc-6.0.10.jar:6.0.10]*
*at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(**ApplicationFilterChain.java:174**)
~[catalina.jar:10.1.8]*
*at
org.apache.catalina.core.ApplicationFilterChain.doFilter(**ApplicationFilterChain.java:149**)
~[catalina.jar:10.1.8]*
*at
org.springframework.security.web.FilterChainProxy.lambda$doFilterInternal$3(**FilterChainProxy.java:231**)
~[spring-security-web-6.1.1.jar:6.1.1]*
*at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(**FilterChainProxy.java:365**)
~[spring-security-web-6.1.1.jar:6.1.1]*
*at
org.springframework.security.web.access.intercept.AuthorizationFilter.doFilter(**AuthorizationFilter.java:100**)
~[spring-security-web-6.1.1.jar:6.1.1]*
*at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(**FilterChainProxy.java:374**)
~[spring-security-web-6.1.1.jar:6.1.1]*
*at
org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(**ExceptionTranslationFilter.java:126**)
~[spring-security-web-6.1.1.jar:6.1.1]*
*at
org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(**ExceptionTranslationFilter.java:120**)
~[spring-security-web-6.1.1.jar:6.1.1]*
*at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(**FilterChainProxy.java:374**)
~[spring-security-web-6.1.1.jar:6.1.1]*
*at
org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(**AnonymousAuthenticationFilter.java:100**)
~[spring-security-web-6.1.1.jar:6.1.1]*
*at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(**FilterChainProxy.java:374**)
~[spring-security-web-6.1.1.jar:6.1.1]*
*at
org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(**SecurityContextHolderAwareRequestFilter.java:179**)
~[spring-security-web-6.1.1.jar:6.1.1]*
*at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(**FilterChainProxy.java:374**)
~[spring-security-web-6.1.1.jar:6.1.1]*
*at
org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(**RequestCacheAwareFilter.java:63**)
~[spring-security-web-6.1.1.jar:6.1.1]*
*at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(**FilterChainProxy.java:374**)
~[spring-security-web-6.1.1.jar:6.1.1]*
*at
org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(**AbstractAuthenticationProcessingFilter.java:227**)
~[spring-security-web-6.1.1.jar:6.1.1]*
*at
org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(**AbstractAuthenticationProcessingFilter.java:221**)
~[spring-security-web-6.1.1.jar:6.1.1]*
*at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(**FilterChainProxy.java:374**)
~[spring-security-web-6.1.1.jar:6.1.1]*
*at
org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(**LogoutFilter.java:107**)
~[spring-security-web-6.1.1.jar:6.1.1]*
*at
org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(**LogoutFilter.java:93**)
~[spring-security-web-6.1.1.jar:6.1.1]*
*at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(**FilterChainProxy.java:374**)
~[spring-security-web-6.1.1.jar:6.1.1]*
*at
org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(**CsrfFilter.java:117**)
~[spring-security-web-6.1.1.jar:6.1.1]*
*at
org.springframework.web.filter.OncePerRequestFilter.doFilter(**OncePerRequestFilter.java:116**)
~[spring-web-6.0.10.jar:6.0.10]*
*at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(**FilterChainProxy.java:374**)
~[spring-security-web-6.1.1.jar:6.1.1]*
*at
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(**CharacterEncodingFilter.java:201**)
~[spring-web-6.0.10.jar:6.0.10]*
*at
org.springframework.web.filter.OncePerRequestFilter.doFilter(**OncePerRequestFilter.java:116**)
~[spring-web-6.0.10.jar:6.0.10]*
*at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(**FilterChainProxy.java:374**)
~[spring-security-web-6.1.1.jar:6.1.1]*
*at
org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(**HeaderWriterFilter.java:90**)
~[spring-security-web-6.1.1.jar:6.1.1]*
*at
org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(**HeaderWriterFilter.java:75**)
~[spring-security-web-6.1.1.jar:6.1.1]*
*at
org.springframework.web.filter.OncePerRequestFilter.doFilter(**OncePerRequestFilter.java:116**)
~[spring-web-6.0.10.jar:6.0.10]*
*at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(**FilterChainProxy.java:374**)
~[spring-security-web-6.1.1.jar:6.1.1]*
*at
org.springframework.security.web.context.SecurityContextHolderFilter.doFilter(**SecurityContextHolderFilter.java:82**)
~[spring-security-web-6.1.1.jar:6.1.1]*
*at
org.springframework.security.web.context.SecurityContextHolderFilter.doFilter(**SecurityContextHolderFilter.java:69**)
~[spring-security-web-6.1.1.jar:6.1.1]*
*at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(**FilterChainProxy.java:374**)
~[spring-security-web-6.1.1.jar:6.1.1]*
*at
org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(**WebAsyncManagerIntegrationFilter.java:62**)
~[spring-security-web-6.1.1.jar:6.1.1]*
*at
org.springframework.web.filter.OncePerRequestFilter.doFilter(**OncePerRequestFilter.java:116**)
~[spring-web-6.0.10.jar:6.0.10]*
*at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(**FilterChainProxy.java:374**)
~[spring-security-web-6.1.1.jar:6.1.1]*
*at
org.springframework.security.web.session.DisableEncodeUrlFilter.doFilterInternal(**DisableEncodeUrlFilter.java:42**)
~[spring-security-web-6.1.1.jar:6.1.1]*
*at
org.springframework.web.filter.OncePerRequestFilter.doFilter(**OncePerRequestFilter.java:116**)
~[spring-web-6.0.10.jar:6.0.10]*
*at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(**FilterChainProxy.java:374**)
~[spring-security-web-6.1.1.jar:6.1.1]*
*at
org.springframework.security.web.FilterChainProxy.doFilterInternal(**FilterChainProxy.java:233**)
~[spring-security-web-6.1.1.jar:6.1.1]*
*at
org.springframework.security.web.FilterChainProxy.doFilter(**FilterChainProxy.java:191**)
~[spring-security-web-6.1.1.jar:6.1.1]*
*at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(**DelegatingFilterProxy.java:352**)
~[spring-web-6.0.10.jar:6.0.10]*
*at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(**DelegatingFilterProxy.java:268**)
~[spring-web-6.0.10.jar:6.0.10]*
*at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(**ApplicationFilterChain.java:174**)
~[catalina.jar:10.1.8]*
*at
org.apache.catalina.core.ApplicationFilterChain.doFilter(**ApplicationFilterChain.java:149**)
~[catalina.jar:10.1.8]*
*at
org.springframework.boot.web.servlet.support.ErrorPageFilter.doFilter(**ErrorPageFilter.java:124**)
~[spring-boot-3.1.1.jar:3.1.1]*
*at
org.springframework.boot.web.servlet.support.ErrorPageFilter$1.doFilterInternal(**ErrorPageFilter.java:99**)
~[spring-boot-3.1.1.jar:3.1.1]*
*at
org.springframework.web.filter.OncePerRequestFilter.doFilter(**OncePerRequestFilter.java:116**)
~[spring-web-6.0.10.jar:6.0.10]*
*at
org.springframework.boot.web.servlet.support.ErrorPageFilter.doFilter(**ErrorPageFilter.java:117**)
~[spring-boot-3.1.1.jar:3.1.1]*
*at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(**ApplicationFilterChain.java:174**)
~[catalina.jar:10.1.8]*
*at
org.apache.catalina.core.ApplicationFilterChain.doFilter(**ApplicationFilterChain.java:149**)
~[catalina.jar:10.1.8]*
*at
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(**CharacterEncodingFilter.java:201**)
~[spring-web-6.0.10.jar:6.0.10]*
*at
org.springframework.web.filter.OncePerRequestFilter.doFilter(**OncePerRequestFilter.java:116**)
~[spring-web-6.0.10.jar:6.0.10]*
*at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(**ApplicationFilterChain.java:174**)
~[catalina.jar:10.1.8]*
*at
org.apache.catalina.core.ApplicationFilterChain.doFilter(**ApplicationFilterChain.java:149**)
~[catalina.jar:10.1.8]*
*at
org.apache.catalina.core.StandardWrapperValve.invoke(**StandardWrapperValve.java:166**)
~[catalina.jar:10.1.8]*
*at org.apache.catalina.core.StandardContextValve.invoke(**StandardContextValve.java:90**)
~[catalina.jar:10.1.8]*
*at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(**AuthenticatorBase.java:482**)
~[catalina.jar:10.1.8]*
*at org.apache.catalina.core.StandardHostValve.invoke(**StandardHostValve.java:115**)
~[catalina.jar:10.1.8]*
*at org.apache.catalina.valves.ErrorReportValve.invoke(**ErrorReportValve.java:93**)
~[catalina.jar:10.1.8]*
*at
org.apache.catalina.valves.AbstractAccessLogValve.invoke(**AbstractAccessLogValve.java:676**)
~[catalina.jar:10.1.8]*
*at org.apache.catalina.core.StandardEngineValve.invoke(**StandardEngineValve.java:74**)
~[catalina.jar:10.1.8]*
*at org.apache.catalina.connector.CoyoteAdapter.service(**CoyoteAdapter.java:341**)
~[catalina.jar:10.1.8]*
*at org.apache.coyote.http11.Http11Processor.service(**Http11Processor.java:390**)
~[tomcat-coyote.jar:10.1.8]*
*at org.apache.coyote.AbstractProcessorLight.process(**AbstractProcessorLight.java:63**)
~[tomcat-coyote.jar:10.1.8]*
*at
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(**AbstractProtocol.java:894**)
~[tomcat-coyote.jar:10.1.8]*
*at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(**NioEndpoint.java:1741**)
~[tomcat-coyote.jar:10.1.8]*
*at org.apache.tomcat.util.net.SocketProcessorBase.run(**SocketProcessorBase.java:52**)
~[tomcat-coyote.jar:10.1.8]*
*at
org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(**ThreadPoolExecutor.java:1191**)
~[tomcat-util.jar:10.1.8]*
*at
org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(**ThreadPoolExecutor.java:659**)
~[tomcat-util.jar:10.1.8]*
*at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(**TaskThread.java:61**)
~[tomcat-util.jar:10.1.8]*
*at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]*
If I comment line countCriteria.where(fromRestriction); it works ok
It works also in spring boot 2.7.5 with hibernate 5.6.12
Is it a bug in the new version of hibernate?
Is it a workaround to fix this?
Thank you,
Adrian
(
https://hibernate.atlassian.net/browse/HHH-16863#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16863#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100227- sha1:534ec1c )