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

**Code:** `circular references` · **Category:** Java · **Seen on:** Java

Two or more Spring beans depend on each other through constructors, and Spring Boot 2.6+ forbids cycles by default.

## Meaning

A → B → A cycles can’t be built with constructor injection. Spring prints the cycle; the fix is usually a design change.

## Common causes

- Services injecting each other
- Configuration classes depending on beans they define

## Quick fix

1. Extract shared logic into a third bean
2. Use events or interfaces to decouple
3. As a last resort, @Lazy on one injection point

## Detailed fix by platform

### Java

1. `public OrderService(@Lazy PaymentService payments) { … }`

## How to diagnose

1. **Cycle** — Which beans are listed?
2. **Recent change** — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/java/spring-circular-references)
