Springboot --- Bug集

一. 启动springboot报错:找不到或没法加载主类mysql

  解决:直接选中项目,在ecplise选中"project",点击clean 清理项目再运行 问题解决。spring

二.报错:Failed to auto-configure a DataSource: 'spring.datasource.url' is not specified and no embedded datasource could be auto-configured.sql

 解决:由于添加了springboot整合mybatis的jar包,链接mysql的jar包,可是没有配置响应的数据源致使该报错springboot

    1. 配置可用的数据源mybatis

    2. 在启动类的@EnableAutoConfiguration或@SpringBootApplication中添加exclude= {DataSourceAutoConfiguration.class},排除此类的autoconfig。启动之后就能够正常运行。url

相关文章
相关标签/搜索