Dhanunjaya,
It is possible that some of the properties have changed name.
Check the docs and / or
./gradlew exportConfigMetadata
Which will list deprecated properties and their replacement.
Ray
On Thu, 2024-04-18 at 00:16 -0700, Dhanunjaya Y wrote:
Notice: This message was sent from outside the University of Victoria email
system. Please be cautious with links and sensitive information.
Hello All,
I am upgrading the CAS version from 6.5.x to 6.6.15 to remove certain
vulnerable libraries.
I am facing the below Bean Creation exception when I added events-related
components. the same configuration works well with 6.5.x.
Please review and suggest what is missing...
I have configured and run the CAS on tomcat server (not embedded).
POM details:
<dependency>
<groupId>org.apereo.cas</groupId>
<artifactId>cas-server-support-events-jpa</artifactId>
<version>${cas.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apereo.cas</groupId>
<artifactId>cas-server-core-logout-api</artifactId>
<version>${cas.version}</version>
<scope>runtime</scope>
</dependency>
CAS.properties:
#cas events
cas.events.core.enabled=true
cas.events.jpa.ddl-auto=none
cas.events.jpa.dialect=${hibernate.db.dialect}
cas.events.jpa.data-source-name=${data.source.cas}
Exception Details:
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'casEventRepository': Injection of persistence dependencies failed;
nested exception is java.lang.ClassCastException: class
org.springframework.beans.factory.support.NullBean cannot be cast to class
javax.persistence.EntityManagerFactory
(org.springframework.beans.factory.support.NullBean and
javax.persistence.EntityManagerFactory are in unnamed module of loader
org.apache.catalina.loader.ParallelWebappClassLoader @5929059c)
at
org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessProperties(PersistenceAnnotationBeanPostProcessor.java:351)
~[spring-orm-5.3.22.jar:5.3.22]
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431)
~[spring-beans-5.3.22.jar:5.3.22]
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619)
~[spring-beans-5.3.22.jar:5.3.22]
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
~[spring-beans-5.3.22.jar:5.3.22]
at
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$1(AbstractBeanFactory.java:374)
~[spring-beans-5.3.22.jar:5.3.22]
at
org.springframework.cloud.context.scope.GenericScope$BeanLifecycleWrapper.getBean(GenericScope.java:376)
~[spring-cloud-context-3.1.3.jar:3.1.3]
at
org.springframework.cloud.context.scope.GenericScope.get(GenericScope.java:179)
~[spring-cloud-context-3.1.3.jar:3.1.3]
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:371)
~[spring-beans-5.3.22.jar:5.3.22]
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
~[spring-beans-5.3.22.jar:5.3.22]
at
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154)
~[spring-context-5.3.22.jar:5.3.22]
at
org.springframework.cloud.context.scope.refresh.RefreshScope.eagerlyInitialize(RefreshScope.java:125)
~[spring-cloud-context-3.1.3.jar:3.1.3]
at
org.springframework.cloud.context.scope.refresh.RefreshScope.start(RefreshScope.java:117)
~[spring-cloud-context-3.1.3.jar:3.1.3]
at
org.springframework.cloud.context.scope.refresh.RefreshScope.onApplicationEvent(RefreshScope.java:112)
~[spring-cloud-context-3.1.3.jar:3.1.3]
at
org.springframework.cloud.context.scope.refresh.RefreshScope.onApplicationEvent(RefreshScope.java:67)
~[spring-cloud-context-3.1.3.jar:3.1.3]
at
org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
~[spring-context-5.3.22.jar:5.3.22]
at
org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
~[spring-context-5.3.22.jar:5.3.22]
at
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
~[spring-context-5.3.22.jar:5.3.22]
at
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:421)
~[spring-context-5.3.22.jar:5.3.22]
at
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:378)
~[spring-context-5.3.22.jar:5.3.22]
at
org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:938)
~[spring-context-5.3.22.jar:5.3.22]
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586)
~[spring-context-5.3.22.jar:5.3.22]
at
org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147)
~[spring-boot-2.7.3.jar:2.7.3]
at
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:734)
~[spring-boot-2.7.3.jar:2.7.3]
at
org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408)
~[spring-boot-2.7.3.jar:2.7.3]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:308)
~[spring-boot-2.7.3.jar:2.7.3]
at
org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:175)
~[spring-boot-2.7.3.jar:2.7.3]
at
org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:155)
~[spring-boot-2.7.3.jar:2.7.3]
at
org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:97)
~[spring-boot-2.7.3.jar:2.7.3]
at
org.apereo.cas.util.spring.boot.AbstractCasSpringBootServletInitializer.onStartup(AbstractCasSpringBootServletInitializer.java:33)
~[cas-server-core-util-api-6.6.15.jar:6.6.15]
at
org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:174)
~[spring-web-5.3.22.jar:5.3.22]
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5166)
~[catalina.jar:9.0.43]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
~[catalina.jar:9.0.43]
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
~[catalina.jar:9.0.43]
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
~[catalina.jar:9.0.43]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
at
org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
~[tomcat-util.jar:9.0.43]
at
java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
~[?:?]
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
~[catalina.jar:9.0.43]
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:843)
~[catalina.jar:9.0.43]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
~[catalina.jar:9.0.43]
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
~[catalina.jar:9.0.43]
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
~[catalina.jar:9.0.43]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
at
org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
~[tomcat-util.jar:9.0.43]
at
java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
~[?:?]
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
~[catalina.jar:9.0.43]
at
org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
~[catalina.jar:9.0.43]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
~[catalina.jar:9.0.43]
at
org.apache.catalina.core.StandardService.startInternal(StandardService.java:434)
~[catalina.jar:9.0.43]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
~[catalina.jar:9.0.43]
at
org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
~[catalina.jar:9.0.43]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
~[catalina.jar:9.0.43]
at org.apache.catalina.startup.Catalina.start(Catalina.java:772)
~[catalina.jar:9.0.43]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at
jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
~[?:?]
at
jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:342)
~[bootstrap.jar:9.0.43]
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)
~[bootstrap.jar:9.0.43]
Caused by: java.lang.ClassCastException: class
org.springframework.beans.factory.support.NullBean cannot be cast to class
javax.persistence.EntityManagerFactory
(org.springframework.beans.factory.support.NullBean and
javax.persistence.EntityManagerFactory are in unnamed module of loader
org.apache.catalina.loader.ParallelWebappClassLoader @5929059c)
at
org.springframework.orm.jpa.EntityManagerFactoryUtils.findEntityManagerFactory(EntityManagerFactoryUtils.java:109)
~[spring-orm-5.3.22.jar:5.3.22]
at
org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findNamedEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:545)
~[spring-orm-5.3.22.jar:5.3.22]
at
org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:525)
~[spring-orm-5.3.22.jar:5.3.22]
at
org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.resolveEntityManager(PersistenceAnnotationBeanPostProcessor.java:696)
~[spring-orm-5.3.22.jar:5.3.22]
at
org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.getResourceToInject(PersistenceAnnotationBeanPostProcessor.java:669)
~[spring-orm-5.3.22.jar:5.3.22]
at
org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:228)
~[spring-beans-5.3.22.jar:5.3.22]
at
org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119)
~[spring-beans-5.3.22.jar:5.3.22]
at
org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessProperties(PersistenceAnnotationBeanPostProcessor.java:348)
~[spring-orm-5.3.22.jar:5.3.22]
... 58 more
--
- 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 [email protected].
To view this discussion on the web visit
https://groups.google.com/a/apereo.org/d/msgid/cas-user/e33d6995e50d2014e1a819ccd7460ad136ca4588.camel%40uvic.ca.