org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'repositoryRelProvider': Requested bean is currently in creation: Is there an unresolvable circular reference?

Spring JIRA | Adelino Rodrigues | 2 years ago
  1. 0

    A web module with following configuration {code:xml} <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd"> <context:component-scan base-package="com.myapp" /> <mvc:annotation-driven /> <mvc:default-servlet-handler /> <bean id="repositoryRestMvcConfiguration" class="com.myapp.web.config.SpringDataRestConfiguration" /> </beans> {code} and with {code:java} package com.myapp.web.config; @Configuration @Import(RepositoryRestMvcConfiguration.class) public class SpringDataRestConfiguration extends RepositoryRestMvcConfiguration { // ... } {code} will throw the following exception at start up: {noformat} org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'repositoryRelProvider': Requested bean is currently in creation: Is there an unresolvable circular reference? at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.beforeSingletonCreation(DefaultSingletonBeanRegistry.java:335) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) {noformat}

    Spring JIRA | 2 years ago | Adelino Rodrigues
    org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'repositoryRelProvider': Requested bean is currently in creation: Is there an unresolvable circular reference?
  2. 0

    A web module with following configuration {code:xml} <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd"> <context:component-scan base-package="com.myapp" /> <mvc:annotation-driven /> <mvc:default-servlet-handler /> <bean id="repositoryRestMvcConfiguration" class="com.myapp.web.config.SpringDataRestConfiguration" /> </beans> {code} and with {code:java} package com.myapp.web.config; @Configuration @Import(RepositoryRestMvcConfiguration.class) public class SpringDataRestConfiguration extends RepositoryRestMvcConfiguration { // ... } {code} will throw the following exception at start up: {noformat} org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'repositoryRelProvider': Requested bean is currently in creation: Is there an unresolvable circular reference? at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.beforeSingletonCreation(DefaultSingletonBeanRegistry.java:335) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) {noformat}

    Spring JIRA | 2 years ago | Adelino Rodrigues
    org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'repositoryRelProvider': Requested bean is currently in creation: Is there an unresolvable circular reference?
  3. 0

    @EnableBatchProcessing(modular = true) fails with schema.sql

    GitHub | 2 years ago | sddakoty
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'companyService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private sample.CompanyRepository sample.CompanyService.dao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'companyRepository': Cannot create inner bean '(inner bean)#1e0b3d7' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#1e0b3d7': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory': Post-processing of FactoryBean's singleton object failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.batch.core.configuration.annotation.ModularBatchConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private java.util.Collection org.springframework.batch.core.configuration.annotation.ModularBatchConfiguration.configurers; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jpaBatchConfigurer' defined in class path resource [org/springframework/boot/autoconfigure/batch/BatchAutoConfiguration$JpaBatchConfiguration.class]: Unsatisfied dependency expressed through constructor argument with index 1 of type [javax.persistence.EntityManagerFactory]: : Error creating bean with name 'entityManagerFactory': Post-processing of FactoryBean's singleton object failed; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'jobRegistrar': Requested bean is currently in creation: Is there an unresolvable circular reference?; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory': Post-processing of FactoryBean's singleton object failed; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'jobRegistrar': Requested bean is currently in creation: Is there an unresolvable circular reference?
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    JNDI lookup fails (Spring, JBoss)

    Stack Overflow | 5 years ago | Tomas
    org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'txm': FactoryBean which is currently in creation returned null from getObject
  6. 0

    Profile methods not loading

    Stack Overflow | 2 years ago | user672009
    org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'entityManagerFactory': Requested bean is currently in creation: Is there an unresolvable circular reference?

  1. Pilleo 2 times, last 2 months ago
7 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.springframework.beans.factory.BeanCurrentlyInCreationException

    Error creating bean with name 'repositoryRelProvider': Requested bean is currently in creation: Is there an unresolvable circular reference?

    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.beforeSingletonCreation()
  2. Spring Beans
    AbstractBeanFactory.getBean
    1. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.beforeSingletonCreation(DefaultSingletonBeanRegistry.java:335)
    2. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    3. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
    4. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
    4 frames