My configuration mistake mentioned above was that I tried to connect to the sybase db this time (Not MS SQL) with below configuration after the cas version upgraded to 6.6.6:
cas.service-registry.jpa.enabled=true
cas.service-registry.jpa.driver-class=net.sourceforge.jtds.jdbc.Driver
cas.service-registry.jpa.user=
cas.service-registry.jpa.password=
cas.service-registry.jpa.url=
cas.service-registry.jpa.dialect=org.hibernate.dialect.SybaseASE15Dialect
It seems that ANOTHER error was occoured:
cas-overlay-cas-1 | 2023-03-16 12:58:11,347 ERROR [com.zaxxer.hikari.pool.PoolBase] - <55e6e78e-a96d-4eab-87cb-40339b4ca569 - Failed to execute isValid() for connection, configure connection test
query (null).>
cas-overlay-cas-1 | 2023-03-16 12:58:11,352 ERROR [org.springframework.boot.web.embedded.tomcat.TomcatStarter] - <Error starting Tomcat context. Exception: org.springframework.beans.factory.Unsati
sfiedDependencyException. Message: Error creating bean with name 'casCorsFilter' defined in class path resource [org/apereo/cas/config/CasFiltersConfiguration$CasFiltersCorsConfiguration.class]: Unsa
tisfied dependency expressed through method 'casCorsFilter' parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'corsHttpW
ebRequestConfigurationSource' defined in class path resource [org/apereo/cas/config/CasFiltersConfiguration$CasFiltersCorsConfiguration.class]: Unsatisfied dependency expressed through method 'corsHt
tpWebRequestConfigurationSource' parameter 3; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'servicesManager' defined in class pa
th resource [org/apereo/cas/config/CasCoreServicesConfiguration$CasCoreServicesManagerConfiguration.class]: Unsatisfied dependency expressed through method 'servicesManager' parameter 0; nested excep
tion is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'defaultServicesManagerExecutionPlanConfigurer' defined in class path resource [org/apereo/cas/
config/CasCoreServicesConfiguration$CasCoreServicesManagerExecutionPlanConfiguration.class]: Unsatisfied dependency expressed through method 'defaultServicesManagerExecutionPlanConfigurer' parameter
1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'servicesManagerConfigurationContext' defined in class path resource [org/apereo
/cas/config/CasCoreServicesConfiguration$CasCoreServicesManagerExecutionPlanConfiguration.class]: Unsatisfied dependency expressed through method 'servicesManagerConfigurationContext' parameter 0; ne
sted exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'serviceRegistry' defined in class path resource [org/apereo/cas/config/CasCoreServic
esConfiguration$CasCoreServiceRegistryConfiguration.class]: Unsatisfied dependency expressed through method 'serviceRegistry' parameter 2; nested exception is org.springframework.beans.factory.BeanCr
eationException: Error creating bean with name 'serviceRegistryExecutionPlan' defined in class path resource [org/apereo/cas/config/CasCoreServicesConfiguration$CasCoreServiceRegistryPlanConfiguratio
n.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apereo.cas.services.ServiceRegistryExecuti
onPlan]: Factory method 'serviceRegistryExecutionPlan' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jpaService
RegistryExecutionPlanConfigurer' defined in class path resource [org/apereo/cas/config/JpaServiceRegistryConfiguration$JpaServiceRegistryPlanConfiguration.class]: Unsatisfied dependency expressed thr
ough method 'jpaServiceRegistryExecutionPlanConfigurer' parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jpaServiceReg
istry' defined in class path resource [org/apereo/cas/config/JpaServiceRegistryConfiguration$JpaServiceRegistryBaseConfiguration.class]: Unsatisfied dependency expressed through method 'jpaServiceReg
istry' parameter 2; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jdbcServiceRegistryTransactionTemplate' defined in class path
resource [org/apereo/cas/config/JpaServiceRegistryConfiguration$JpaServiceRegistryTransactionConfiguration.class]: Unsatisfied dependency expressed through method 'jdbcServiceRegistryTransactionTempl
ate' parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'transactionManagerServiceReg' defined in class path resource [or
g/apereo/cas/config/JpaServiceRegistryConfiguration$JpaServiceRegistryTransactionConfiguration.class]: Unsatisfied dependency expressed through method 'transactionManagerServiceReg' parameter 1; nest
ed exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serviceEntityManagerFactory' defined in class path resource [org/apereo/cas/config/JpaServiceRe
gistryConfiguration$JpaServiceRegistryEntityConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to ins
tantiate [org.springframework.beans.factory.FactoryBean]: Factory method 'serviceEntityManagerFactory' threw exception; nested exception is java.lang.AbstractMethodError>
cas-overlay-cas-1 | 2023-03-16 12:58:11,364 WARN [org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext] - <Exception encountered during context initializ
ation - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Un
able to start embedded Tomcat>
So, it works finally after I added one more OPTIOANL configuration as below.
cas.service-registry.jpa.health-query=SELECT 1
Maybe my db is kind of "legacy" database anyways.
If connecting to MSSQL, everything is working after the cas version upgraded. (without the need to add the OPTIONAL configuration)