Scrivio Interview library
DebuggingIntermediate7 min read · updated 12 November 2026

Spring logs 'Bean X is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)'. What does it mean and why does it matter?

The message means bean X was created while Spring was still registering the BeanPostProcessors, usually because a post-processor, or the @Configuration class that declares one, depends on it. Post-processors registered after that moment never saw X, so it may be missing its @Transactional or @Async proxy and other processing, and it will quietly not behave as annotated. We fix it by declaring post-processor @Bean methods static, by injecting dependencies into post-processors lazily with ObjectProvider, or by removing the dependency.

Why this question is asked

This message is easy to ignore: it is logged once at startup, the application starts, and most of the time everything seems to work. Then one day someone notices that a method annotated with @Transactional never rolls back, or that an @Async method runs on the caller's thread, and the trail leads back to this line. Interviewers ask it to see whether we know how post-processors are created and why their creation order affects other beans. In this answer, we will recap how Spring registers post-processors, reproduce the message, see what X is missing, find the common causes, and go through the fixes.

1A Quick Recap: Post-Processors Come First

A BeanPostProcessor is a special bean that Spring calls for every other bean, before and after its initialisation, and that can modify or replace it. Injection of @Autowired fields, @PostConstruct calls and the proxies behind @Transactional, @Cacheable and @Async are all done by post-processors.

Because they process other beans, they have to exist first. During refresh, before creating regular beans, Spring finds every bean definition that implements BeanPostProcessor, creates those beans in order (PriorityOrdered first, then Ordered, then the rest) and registers each one as soon as it exists. Only after all of them are registered does Spring create the ordinary singletons. Each ordinary bean then passes through the complete chain.

2Reproducing the Message

Here is a configuration class that declares a custom post-processor with an ordinary instance method and also injects a repository.

Java
@Configuration
class AuditConfig {
@Autowired AuditRepository auditRepository; // an ordinary bean, injected into the config
@Bean // instance method: needs an AuditConfig instance
AuditBeanPostProcessor auditBeanPostProcessor() {
return new AuditBeanPostProcessor(auditRepository);
}
}
// INFO/WARN ... Bean 'auditRepository' of type [com.shop.AuditRepository] is not eligible for getting
// processed by all BeanPostProcessors (for example: not eligible for auto-proxying).
// Recent Spring versions also ask: Is this bean getting eagerly injected into a currently created
// BeanPostProcessor [auditBeanPostProcessor]? (check your version for the exact wording)
Step throughHow the repository is created too early
ContextAuditConfigAuditRepositoryAuto-proxy creator
register post-processors
call auditBeanPostProcessor(): need config instance
inject auditRepository: create it now
created, only early processors applied
log: not eligible for all BeanPostProcessors
register auto-proxy creator (too late for repository)
create ordinary beans: they get the full chain

7 messages in order. Play them, or step through them one at a time.

Let us follow what Spring does. It needs auditBeanPostProcessor, so it must call the @Bean method. That method is an instance method, so Spring needs the AuditConfig instance, and creating AuditConfig means injecting AuditRepository. So the repository, together with everything it depends on, such as the EntityManagerFactory and the data source, is created right now, while Spring is in the middle of registering post-processors. A small post-processor called BeanPostProcessorChecker notices that a regular bean was created while not all post-processors exist yet, and logs the message.

3What the Bean Is Missing

The post-processors registered before that moment did process the repository, and the ones registered after it did not. Which ones those are depends on ordering, but the auto-proxy creator and the processors for @Async and validation are often among the late ones. So AuditRepository, and anything created with it, may have no transactional proxy, no @Async proxy, no aspects and no method validation.

The consequences are silent. If AuditRepository has @Transactional methods, they run without a transaction. If a service created this early has @Async methods, they run synchronously on the caller's thread. There is no error and no second warning; the annotation simply does nothing. That is why the message matters even though the application starts.

Java
// A service created early along the same path:
@Service
class AuditWriter {
@Transactional
public void write(Event e) {
System.out.println(TransactionSynchronizationManager.isActualTransactionActive()); // false
System.out.println(AopUtils.isAopProxy(this)); // false
}
}
// The same class created normally prints: true

4The Common Causes

The usual cause is the one we just saw: a post-processor that depends, directly or through its configuration class, on ordinary beans. It takes three forms. A post-processor class has constructor or @Autowired dependencies on services or repositories. A @Bean method for a post-processor is an instance method in a @Configuration class that injects ordinary beans, so the whole configuration class and its dependencies are pulled forward. Or a BeanFactoryPostProcessor or post-processor calls getBean() during its own setup.

The message sometimes appears for framework beans too, from libraries that declare post-processors in the same careless way. When the named bean is infrastructure that genuinely needs no proxying, for example a properties object, the message can be harmless. The question to ask each time is whether the bean in the message, or anything created with it, relies on a post-processor such as transactions, async or aspects.

5Fix 1: Declare the @Bean Method Static

A static @Bean method can be called without an instance of the configuration class. So Spring creates the post-processor without creating AuditConfig and without touching AuditRepository.

Java
@Configuration
class AuditConfig {
@Bean
static AuditBeanPostProcessor auditBeanPostProcessor(ObjectProvider<AuditRepository> repo) {
return new AuditBeanPostProcessor(repo); // repository looked up on first use, not now
}
}
class AuditBeanPostProcessor implements BeanPostProcessor {
private final ObjectProvider<AuditRepository> repo;
AuditBeanPostProcessor(ObjectProvider<AuditRepository> repo) { this.repo = repo; }
// inside postProcessAfterInitialization or in the wrapper it builds: repo.getObject() when needed
}
// startup log: no 'not eligible' message for auditRepository
Step throughDeciding the fix for a 'not eligible' message
  1. Read which bean and which post-processor are named
  2. Does that bean need proxies or other processing?
    YesFix itNoProbably harmless, still prefer to fix
  3. Is the post-processor's @Bean method non-static?
    YesMake it staticNoLook at the post-processor's own dependencies
  4. Does the post-processor need an ordinary bean?
    YesInject ObjectProvider or remove the dependencyNoDone
  5. Restart and confirm the message is gone

5 steps in order. Play them, or step through them one at a time.

Notice that making the method static is only half of the fix. The post-processor itself still needs the repository, so we inject an ObjectProvider, a small handle that looks the bean up when we call getObject(). The repository is then created at the normal time, after every post-processor is registered, and gets the full chain including its proxy. @Lazy on the parameter would also work, since it injects a lazy-resolution proxy, but ObjectProvider makes the delayed lookup visible.

6Fix 2: Remove the Dependency

Often the best fix is to question why a post-processor needs a business bean at all. A post-processor should usually only decide whether to wrap a bean and build the wrapper. If the wrapper needs a service, it can look it up lazily at call time, or the work can be moved into the wrapped bean, an aspect or an event listener, all of which are ordinary beans created at the normal time.

Many cases are best solved without a custom post-processor at all. Spring and Spring Boot offer customiser beans for many components, and aspects get the proxy machinery without any of these ordering traps.

7Follow-up questions

Why does the message say 'for example: not eligible for auto-proxying'?

Because missing the auto-proxy creator is the most common and most harmful consequence. The bean was created before that post-processor was registered, so no AOP proxy, and therefore no @Transactional or aspect behaviour, will ever be applied to it.

Is the message always a problem?

No. If the bean is a plain object that needs no proxy or other post-processing, nothing is lost. But it is cheap to fix with a static @Bean method and an ObjectProvider, and leaving such messages around trains people to ignore the one that matters.

How can we find which post-processor caused it?

Recent Spring versions name the post-processor currently being created in the message. Otherwise, debug logging for the bean factory shows the creation order, and the bean that was created just before the message, together with the configuration class that declares it, usually points to the cause.

8Conclusion

In this answer, we saw that 'not eligible for getting processed by all BeanPostProcessors' means a bean was created while post-processors were still being registered, typically because a post-processor or its configuration class depends on it. Post-processors registered later, such as the auto-proxy creator, never saw that bean, so @Transactional, @Async and aspects can silently do nothing on it. We fixed it by making post-processor @Bean methods static, by injecting dependencies lazily with ObjectProvider, and by removing the dependency where possible.

What to say in the interviewAbout 80 seconds aloud

Open with

It means bean X was created too early, while Spring was still registering the BeanPostProcessors. Spring creates all post-processors before ordinary beans, registering each as soon as it exists.

Then, if they want more

If one of them, or the @Configuration class that declares it, depends on an ordinary bean, that bean and its dependencies are created at that moment, and only the post-processors registered so far are applied to it. BeanPostProcessorChecker notices and logs this line.

It matters because the late post-processors, often the auto-proxy creator and the @Async processor, never see X, so its @Transactional methods run without a transaction and its @Async methods run synchronously, with no error.

The common cause is a post-processor declared with a non-static @Bean method in a configuration class that autowires a repository or service, or a post-processor with constructor dependencies on business beans.

To fix it, I make the @Bean method static, so the configuration class is not created early, and I inject what the post-processor needs through ObjectProvider, so it is looked up on first use after everything is registered. Better still, I remove the dependency, or use an aspect or customiser instead of a custom post-processor. Then I check the startup log that the message is gone.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Spring logs 'Bean X is not eligible for getting processed by all BeanPostProcessors (for...": https://scrivio-interview-library.netlify.app/spring-boot/bean-lifecycle/033ee4dbcb/