OIDC Spring dependency problem in 6.6.0 with change in 6.6.0-RC4?

34 views
Skip to first unread message

Sam Hough

unread,
Jul 26, 2022, 9:58:51 AMJul 26
to CAS Community
Hi,

Anyone else hit a problem using "org.apereo.cas:cas-server-support-oidc" in the 6.6.0 branch?

At first I was getting a problem with:
[org/apereo/cas/oidc/config/OidcJwksJpaConfiguration.class]: Unsatisfied dependency expressed through method 'jpaOidcJwksVendorAdapter' parameter 1; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apereo.cas.jpa.JpaBeanFactory' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Qualifier(value="jpaBeanFactory")}
That was fixed by adding "org.apereo.cas:cas-server-support-jpa-hibernate"

After upgrading to 6.6.0-RC4 I now get:
[org/apereo/cas/oidc/config/OidcJwksJpaConfiguration.class]: Unsatisfied dependency expressed through method 'transactionManagerOidcJwks' parameter 1; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'javax.persistence.EntityManagerFactory' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Qualifier(value="oidcJwksEntityManagerFactory")}

Anyone else hit this? I can't see how the same fix/kludge would work. I don't want to use JPA anyway as I'm happy with config in the file system.

Any suggestions if somebody has hit something similar would be greatly appreciated.

Cheers

Sam

Sam Hough

unread,
Aug 5, 2022, 11:06:37 AMAug 5
to CAS Community, Sam Hough
Hi,

I think the issue is:
* I use org.apereo.cas:cas-server-support-jdbc which pulls in  support-jpa-util
* support-jpa-util contains  JpaBeanFactory
* OidcJwksJpaConfiguration has @ConditionalOnClass(JpaBeanFactory.class)
* Fails as there is no instance of JpaBeanFactory

I've hacked it locally for now but will try and come up with a pull request. Seems dubious that support-jdbc depends on something about JPA. JPA a higher level than JDBC? I've not use @ConditionalOnClass so maybe it could be tweaked to whatever is the factory for instances of JpaBeanFactory?

Any guidance welcome.

Cheers

Sam 
Reply all
Reply to author
Forward
0 new messages