Hi all,
we have a problem with cas 7 overlay template
when we add a module that use JPA, On cas 6.5.7 everything works correctly.

If we integrate jpa ticket registry
*implementation 
"org.apereo.cas:cas-server-support-jpa-ticket-registry:${project.'cas.version'}"*
 
in build.gradle we have the following error

2024-02-28 16:04:25,251 ERROR 
[org.springframework.boot.web.embedded.tomcat.TomcatStarter] - <Error 
starting Tomcat context. Exception: 
org.springframework.beans.factory.UnsatisfiedDependencyException. Message: 
Error creating bean with name 'casCorsFilter' defined in class path 
resource 
[org/apereo/cas/config/CasFiltersConfiguration$CasFiltersCorsConfiguration.class]:
 
Unsatisfied dependency expressed through method 'casCorsFilter' parameter 
1: Error creating bean with name 'corsHttpWebRequestConfigurationSource' 
defined in class path resource 
[org/apereo/cas/config/CasFiltersConfiguration$CasFiltersCorsConfiguration.class]:
 
Unsatisfied dependency expressed through method 
'corsHttpWebRequestConfigurationSource' parameter 3: Error creating bean 
with name 'servicesManager' defined in class path resource 
[org/apereo/cas/config/CasCoreServicesConfiguration$CasCoreServicesManagerConfiguration.class]:
 
Unsatisfied dependency expressed through method 'servicesManager' parameter 
0: 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: 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 1: Error creating bean with 
name 'serviceRegistry' defined in class path resource 
[org/apereo/cas/config/CasCoreServicesConfiguration$CasCoreServiceRegistryConfiguration.class]:
 
Unsatisfied dependency expressed through method 'serviceRegistry' parameter 
2: Error creating bean with name 'serviceRegistryExecutionPlan' defined in 
class path resource 
[org/apereo/cas/config/CasCoreServicesConfiguration$CasCoreServiceRegistryPlanConfiguration.class]:
 
Failed to instantiate 
[org.apereo.cas.services.ServiceRegistryExecutionPlan]: Factory method 
'serviceRegistryExecutionPlan' threw exception with message: Error creating 
bean with name 'jpaServiceRegistryExecutionPlanConfigurer' defined in class 
path resource 
[org/apereo/cas/config/JpaServiceRegistryConfiguration$JpaServiceRegistryPlanConfiguration.class]:
 
Unsatisfied dependency expressed through method 
'jpaServiceRegistryExecutionPlanConfigurer' parameter 1: Error creating 
bean with name 'jpaServiceRegistry': Injection of persistence dependencies 
failed>

Our config properties
cas.service-registry.jpa.driver-class=com.mysql.cj.jdbc.Driver
cas.service-registry.jpa.enabled=true
cas.service-registry.jpa.password=password
cas.service-registry.jpa.url=jdbc:mysql://url
cas.service-registry.jpa.user=username
cas.service-registry.jpa.ddl-auto=update
cas.service-registry.jpa.dialect=org.hibernate.dialect.MySQLDialect
cas.service-registry.jpa.autocommit=true



if we integrate support events jpa

*implementation 
"org.apereo.cas:cas-server-support-events-jpa:${project.'cas.version'}"*we 
have the following error

2024-02-28 16:30:18,500 WARN 
[org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext]
 
- <Exception encountered during context initialization - cancelling refresh 
attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: 
Error creating bean with name 'defaultCasEventListener' defined in class 
path resource 
[org/apereo/cas/config/CasCoreEventsConfiguration$CasCoreEventsListenerConfiguration.class]:
 
Unsatisfied dependency expressed through method 'defaultCasEventListener' 
parameter 3: Error creating bean with name 'casEventRepository': Injection 
of persistence dependencies failed>
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at 
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at 
org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:91)
        at 
org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:53)
        at 
org.springframework.boot.loader.launch.WarLauncher.main(WarLauncher.java:57)
Caused by: 
org.springframework.beans.factory.UnsatisfiedDependencyException: Error 
creating bean with name 'defaultCasEventListener' defined in class path 
resource 
[org/apereo/cas/config/CasCoreEventsConfiguration$CasCoreEventsListenerConfiguration.class]:
 
Unsatisfied dependency expressed through method 'defaultCasEventListener' 
parameter 3: Error creating bean with name 'casEventRepository': Injection 
of persistence dependencies failed
        at 
org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:802)
        at 
org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:546)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1334)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1164)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:561)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$1(AbstractBeanFactory.java:364)
        at 
org.springframework.cloud.context.scope.GenericScope$BeanLifecycleWrapper.getBean(GenericScope.java:375)
        at 
org.springframework.cloud.context.scope.GenericScope.get(GenericScope.java:179)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:361)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
        at 
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1232)
        at 
org.springframework.cloud.context.scope.refresh.RefreshScope.eagerlyInitialize(RefreshScope.java:126)
        at 
org.springframework.cloud.context.scope.refresh.RefreshScope.start(RefreshScope.java:118)
        at 
org.springframework.cloud.context.scope.refresh.RefreshScope.onApplicationEvent(RefreshScope.java:113)
        at 
org.springframework.cloud.context.scope.refresh.RefreshScope.onApplicationEvent(RefreshScope.java:68)
        at 
org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:178)
        at 
org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:171)
        at 
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:149)
        at 
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:451)
        at 
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:384)
        at 
org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:982)
        at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:628)
        at 
org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146)
        at 
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:762)
        at 
org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:464)
        at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:334)
        at 
org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:149)
        at 
org.apereo.cas.web.CasWebApplication.main(CasWebApplication.java:57)
        at 
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        ... 4 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error 
creating bean with name 'casEventRepository': Injection of persistence 
dependencies failed
        at 
org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessProperties(PersistenceAnnotationBeanPostProcessor.java:388)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1418)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:598)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$1(AbstractBeanFactory.java:364)
        at 
org.springframework.cloud.context.scope.GenericScope$BeanLifecycleWrapper.getBean(GenericScope.java:375)
        at 
org.springframework.cloud.context.scope.GenericScope.get(GenericScope.java:179)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:361)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
        at 
org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254)
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1443)
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1353)
        at 
org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:911)
        at 
org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:789)
        ... 33 more
Caused by: java.lang.ClassCastException: class 
org.springframework.beans.factory.support.NullBean cannot be cast to class 
jakarta.persistence.EntityManagerFactory 
(org.springframework.beans.factory.support.NullBean and 
jakarta.persistence.EntityManagerFactory are in unnamed module of loader 
org.springframework.boot.loader.launch.LaunchedClassLoader @5caf905d)
        at 
org.springframework.orm.jpa.EntityManagerFactoryUtils.findEntityManagerFactory(EntityManagerFactoryUtils.java:108)
        at 
org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findNamedEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:574)
        at 
org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:554)
        at 
org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.resolveEntityManager(PersistenceAnnotationBeanPostProcessor.java:724)
        at 
org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.getResourceToInject(PersistenceAnnotationBeanPostProcessor.java:697)
        at 
org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:270)
        at 
org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:145)
        at 
org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessProperties(PersistenceAnnotationBeanPostProcessor.java:385)
        ... 46 more

> Task :run FAILED

FAILURE: Build failed with an exception.


are we doing the configuration wrong?

thanks!



-- 
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
--- 
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cas-user+unsubscr...@apereo.org.
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/62651c9f-54a0-4bd8-9006-4679f09d7992n%40apereo.org.

Reply via email to