Springboot exception: Requested Bean is currently in Creation:is there an unresolvable circular reference?

Source: Internet
Author: User
Tags stack trace

2018-07-31 11:56:18.812 WARN 10316---[main] configservletwebserverapplicationcontext:exception encountered During context initialization-cancelling Refresh attempt: Org.springframework.beans.factory.UnsatisfiedDependencyException:Error creating Bean with Name ' Admincontroller ': Unsatisfied dependency expressed through field ' Adminuserservice '; Nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException:Error creating beans with Name ' Adminuserservice ': Unsatisfied dependency expressed through field ' Basemapper '; Nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException:Error creating beans with Name ' Adminuserdao ' defined in file [E:\antdWorkspace\payadminv5\target\classes\com\paycloudx\dao\AdminUserDao.class]: Unsatisfied dependency expressed through Bean property ' sqlsessionfactory '; Nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException:Error creating beans with Name ' Sqlsessionfactory ' defined inclassPath resource [Com/baomidou/mybatisplus/spring/boot/starter/mybatisplusautoconfiguration.class]: Unsatisfied dependency expressed through method ' sqlsessionfactory ' parameter 0; Nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException:Error creating beans with Name ' DataSource ' defined inclassPath resource [Com/paycloudx/datasources/dynamicdatasourceconfig.class]: Unsatisfied dependency expressed through method ' DataSource ' parameter 0; Nested exception is org.springframework.beans.factory.BeanCreationException:Error creating beans with Name ' Firstdatasource ' defined inclassPath resource [Com/paycloudx/datasources/dynamicdatasourceconfig.class]: Initialization of Bean failed; Nested exception is org.springframework.beans.factory.BeanCreationException:Error creating beans with Name ' Org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker ': Invocation of Init method failed; Nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException:Error creating beans with Name '  DataSource ': Requested Bean is currently in Creation:is there an unresolvable circular reference?2018-07-31 11:56:18.825 INFO 10316---[main] o.apache.catalina.core.standardservice:stopping service [Tomcat]2018-07-31 11:56:18.834 WARN 10316---[ost-startstop-1] o.a.c.loader.webappclassloaderbase:the Web application [ROOT] appears to has started a thread named [Abando Ned connection cleanup thread] but had failed to stop it. This was very likely to create a memory leak. Stack Trace of thread:java.lang.Object.wait (Native Method) java.lang.ref.ReferenceQueue.remove (Referencequeue.java: 143) Com.mysql.cj.jdbc.AbandonedConnectionCleanupThread.run (Abandonedconnectioncleanupthread.java:43)2018-07-31 11:56:18.845 INFO 10316---[main] conditionevaluationreportlogginglistener:error starting ApplicationContext. To display the conditions report re-run your application with ' debug 'enabled.2018-07-31 11:56:18.847 ERROR 10316---[main] O.s.b.d.loggingfailureanalysisreporter:***************************application FAILED to START***************************description:the Dependencies of some of the beans in the application context form a cycle:admincontroller (field 
    Privatecom.paycloudx.service.AdminUserService Com.paycloudx.controller.AdminController.adminUserService) ↓adminuser Service (Fieldprotectedcom.baomidou.mybatisplus.mapper.BaseMapper Com.baomidou.mybatisplus.service.impl.ServiceImpl.baseMapper) ↓ad Minuserdao defined in file [E:\antdWorkspace\payadminv5\target\classes\com\paycloudx\dao\AdminUserDao.class]↓sqlsessionfactory defined inclassPath resource [Com/baomidou/mybatisplus/spring/boot/starter/mybatisplusautoconfiguration.class]┌─────┐| DataSource defined inclassPath resource [Com/paycloudx/datasources/dynamicdatasourceconfig.class]↑↓| Firstdatasource defined inclassPath resource [Com/paycloudx/datasources/dynamicdatasourceconfig.class]↑↓|Org.springframework.boot.autoconfigure.jdbc.datasourceinitializerinvoker└─────┘process finished with exit code 1
Exception Information

Project Framework:

Springboot + Mybatis + Mybatis Plus

Configure the Druid Multi-data source, just set up when the normal start, write good Controller,service,dao and other code, start error.

Baidu does not correspond to the wrong, asked the company's big God, suddenly solved, alas.

Solution:

Start class Annotations:

    @SpringBootApplication (exclude = {Datasourceautoconfiguration.class})

Springboot exception: Requested Bean is currently in Creation:is there an unresolvable circular reference?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.