今天做初始化数据库,报一下异常
***************************
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:\Java\ideaIU\workspace\study\springboot2\demo\target\classes\com\rude\springboot2\demo\dao\UserDao.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); } }
问题解决,好了,不说了,简单的记录下,吃饭去了,都是泪啊!!!