Cannot invoke "org.hibernate.query.BindableType.resolveExpressible(org.hibernate.engine.spi.SessionFactoryImplementor)" because "declaredParameterType" is null

Could you please help on the issue relating to Hibernate migration? I received the following error after upgrade Java from version 8 to version 17, Spring Boot from version 2.6.1 to version 3.0.4 which includes hibernate-core 6.1.7.Final. My code worked fine with Java 8, SpringBoot 2.6.1 with hibernate 5.6.1.Final
Error:
Cannot invoke “org.hibernate.query.BindableType.resolveExpressible(org.hibernate.engine.spi.SessionFactoryImplementor)” because “declaredParameterType” is null

Hibernate 6.1 is not maintained anymore. Please upgrade to Spring 3.1 which comes with Hibernate 6.2