Skip to content
This repository has been archived by the owner on Nov 29, 2022. It is now read-only.

Dependency cycle with SAMLEntryPoint #518

Open
OrangeDog opened this issue Nov 22, 2021 · 2 comments
Open

Dependency cycle with SAMLEntryPoint #518

OrangeDog opened this issue Nov 22, 2021 · 2 comments

Comments

@OrangeDog
Copy link
Contributor

There's a dependency cycle between SAMLDiscovery.setSamlEntryPoint and SAMLEntryPoint.setSamlDiscovery.
This generates an error on startup as of Spring Boot 2.6.

The dependencies of some of the beans in the application context form a cycle:

   samlFilter
┌─────┐
|  samlEntryPoint
↑     ↓
|  samlDiscovery
└─────┘

Workaround is to set spring.main.allow-circular-references=true.

@wilkinsona
Copy link
Contributor

This could also affect users of earlier Spring Boot versions or of plain Spring Framework if they've set AbstractAutowireCapableBeanFactory.setAllowCircularReferences(boolean) to false as Boot does by default as of 2.6.

@OrangeDog OrangeDog changed the title Bean dependency cycle with Boot 2.6 Dependency cycle with SAMLEntryPoint Jan 26, 2022
@gertjanal
Copy link

Workaround for Spring Boot:

final SpringApplicationBuilder builder = new SpringApplicationBuilder(applicationClass)
    .allowCircularReferences(true)
    ...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants