@ConditionalOnMissingBean did not find any beans (OnBeanCondition)

The spring boot application runs on auto configuration mode. On a configuration change, that matches a dependent class but not loaded in the bean factory.



Auto Configuration Report

Positive matches:
  - @ConditionalOnMissingBean (types: org.springframework.orm.jpa.support.OpenEntityManagerInViewInterceptor,org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter; SearchStrategy: all) did not find any beans (OnBeanCondition)


Root Cause

If the spring boot application configuration has changed and if @ConditionalOnMissingBean matches the condition and the bean is not loaded in beanfactory, then this log is shown in auto configuration report.



Reason

@ConditionalOnMissingBean - Conditional that only matches when 
no beans meeting the specified requirements are already contained
in the BeanFactory. None of the requirements must be met for the 
condition to match and the requirements do not have to be met by the same bean.

Explanation

The class “org.springframework.orm.jpa.support.OpenEntityManagerInViewInterceptor” is not loaded in bean factory. This class is not available in spring boot.

A spring configuration is changed. This configuration is available as @ConditionalOnMissingBean for the above class and condition matches true.



Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *