概述
今天做初始化数据库,报一下异常
***************************
APPLICATION FAILED TO START
***************************
Description:
The dependencies of some of the beans in the application context form a cycle:
userServiceImpl (field com.rude.springboot2.demo.dao.UserDao com.rude.springboot2.demo.service.impl.UserServiceImpl.userDao)
↓
userDao defined in file [D:JavaideaIUworkspacestudyspringboot2demotargetclassescomrudespringboot2demodaoUserDao.class]
┌─────┐
| sqlManagerFactoryBean defined in class path resource [com/ibeetl/starter/BeetlSqlSingleConfig.class]
↑ ↓
| beetlSqlDataSource defined in class path resource [com/ibeetl/starter/BeetlSqlSingleConfig.class]
↑ ↓
| dataSource defined in class path resource [com/rude/springboot2/demo/config/BeetlSqlConfiguration.class]
↑ ↓
| org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker
└─────┘
这就尴尬了,查了一天,还看了源代码,一天没吃饭了,中午查出来了。
解决方法,将代码下列代码添加 exclude = DataSourceAutoConfiguration.class
@SpringBootApplication public class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } }
为:
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class) public class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } }
问题解决,好了,不说了,简单的记录下,吃饭去了,都是泪啊!!!
最后
以上就是忐忑奇迹为你收集整理的SpringBoot2 初始数据库循环依赖 The dependencies of some of the beans in the application context form a cycle的全部内容,希望文章能够帮你解决SpringBoot2 初始数据库循环依赖 The dependencies of some of the beans in the application context form a cycle所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复