美文网首页
SpringBoot启动错误

SpringBoot启动错误

作者: firststep | 来源:发表于2019-01-09 16:45 被阅读0次

错误信息

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2017-11-16 15:32:12.994 ERROR 2668 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Cannot determine embedded database driver class for database type NONE

Action:

If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).`

原因是:springboot启动时会自动注入数据源和配置jpa
解决:1. 下面代码注释掉

 dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.mybatis.spring.boot</groupId>
            <artifactId>mybatis-spring-boot-starter</artifactId>
            <version>1.3.2</version>
        </dependency>
  1. 修改@SpringBootApplication 成 @SpringBootApplication(exclude={DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class})
最后结果: image.png

相关文章

网友评论

      本文标题:SpringBoot启动错误

      本文链接:https://www.haomeiwen.com/subject/xtugrqtx.html