Spring boot 启动报错 Failed to auto-configure a DataSource
2018-03-29 10:13
591 查看
第一次搭建spring boot,选择了web,mysql,mybatis,thymeleaf功能。启动时报错:***************************
APPLICATION FAILED TO START
***************************Description:Failed to auto-configure a DataSource: 'spring.datasource.url' is not specified and no embedded datasource could be auto-configured.Reason: Failed to determine a suitable driver class该问题的解决方法是:在启动类的@EnableAutoConfiguration或@SpringBootApplication后添加(exclude = {DataSourceAutoConfiguration.class}),排除此类的autoconfig。启动以后就可以正常运行。这是因为添加了数据库组件,所以autoconfig会去读取数据源配置,而我新建的项目还没有配置数据源,所以会导致异常出现。
转载:http://www.cnblogs.com/wjw1210/p/8571717.html
APPLICATION FAILED TO START
***************************Description:Failed to auto-configure a DataSource: 'spring.datasource.url' is not specified and no embedded datasource could be auto-configured.Reason: Failed to determine a suitable driver class该问题的解决方法是:在启动类的@EnableAutoConfiguration或@SpringBootApplication后添加(exclude = {DataSourceAutoConfiguration.class}),排除此类的autoconfig。启动以后就可以正常运行。这是因为添加了数据库组件,所以autoconfig会去读取数据源配置,而我新建的项目还没有配置数据源,所以会导致异常出现。
转载:http://www.cnblogs.com/wjw1210/p/8571717.html
相关文章推荐
- Spring boot 启动报错 Failed to auto-configure a DataSource
- Spring boot 启动报错 Failed to auto-configure a DataSource
- Spring boot 启动报错 Failed to auto-configure a DataSource
- Spring boot 启动报错 Failed to auto-configure a DataSource
- 启动Spring Boot 项目 报错:Application failed to start with classpath
- Error creating bean with name 'org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfigurati
- Spring Boot启动报错:Failed to instantiate [ClassName]: No default constructor found;
- springboot 启动报错 java.lang.IllegalStateException: Failed to introspect annotated methods on class org
- Error creating bean with name 'org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfigurati
- 关于springboot启动时候报错:springboot Failed to parse configuration class [Application]
- SpringBoot 启动服务器失败 报错 spring-boot Failed to start component [StandardServer[-1]]
- IntelliJ IDEA启动spring boot项目出现Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[]]
- Failed to introspect annotated methods on class org.springframework.boot.web.support.SpringBootServl
- Oracle自动启动(解决了Failed to auto-start Oracle Net Listene和Message 1053 not found错误)
- Springboot启动报错:Your ApplicationContext is unlikely to start due to a @ComponentScan of the default
- Failed to introspect annotated methods on class org.springframework.boot.web.support.SpringBootServl
- spring boot No qualifying bean of type [org.springframework.boot.autoconfigure.web.ErrorAttributes]
- Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
- SpringBoot 启动报错:Unable to start embedded
- How to configure spring boot through annotations in order to have something similar to <jsp-config> in web.xml?