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

107 views
Skip to first unread message

Sam Hough

unread,
Jul 26, 2022, 9:58:51 AM7/26/22
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 AM8/5/22
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 

Sam Hough

unread,
Nov 4, 2022, 7:15:50 AM11/4/22
to CAS Community, Sam Hough
Hi,

In case anyone else hits this. mmoayyed suggested a workaround here https://github.com/apereo/cas/pull/5538#issuecomment-1303193825 that seems to be based on code added in this commit https://github.com/apereo/cas/commit/94b32c39bf76e261484c9bbb7106bb2834c4dc21 ?

I'd not heard of the CasFeatureModule stuff before and googling didn't help me very much. Anyway, adding --CasFeatureModule.OpenIDConnect.jpa.enabled=false as a command line option seemed to fix it.

Cheers

Sam

Reply all
Reply to author
Forward
0 new messages