记录springboot 启动时报错:If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class
Action:
Consider the following:If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).

从报错来看是启动时找不到数据库的url,但是项目之前时没有问题的,且已经合适过自己的配置和数据库运行结果,查询网上的说法,大概分成几种情况
1>添加 exclude = {DataSourceAutoConfiguration.class},排除springboot启动时的自动加载;
2>在pom.xml添加 <resource> <directory>src/main/resources</directory> <includes> <include>**/*.yml</include> </includes></resource> ,在pom.xml中指定加载的配置文件
3> 还有说时多个环境导致配置文件没有被加载正确
事实上我们启动的的代码时我们编译的target,首先需要确认target中的dataSource配置是否正确,这个时候发现target中并没有相应的*.yml文件;到这里我们真正的找到程序报错的原因,那么接下来就要解决是什么原因导致的target中没有相应的,这是因为我的pom.xml文件中增加了一条数据:<packaging>pom</packaging>,将该条信息删除,重新 mvn install,可以看到target下
,重新启动springboot就可以了

记录springboot 启动时报错:no profiles are currently active相关推荐

  1. SpringBoot启动时报错

    SpringBoot启动时报错 SpringBoot启动时报错 报错信息 解决 报错信息 Field memberBaseMapper in com.kasite.client.business.mo ...

  2. 关于springboot启动时报错 [org/springframework/boot/autoconfigure/web/ServerPropertiesAutoConfiguration.clas

    问题描述 添加负载均衡Ribbon后,启动springboot时 [org/springframework/boot/autoconfigure/web/ServerPropertiesAutoCon ...

  3. springboot启动时报错Logging system failed to initialize using configuration from 'classpath:logging-conf

    项目报错: Logging system failed to initialize using configuration from 'classpath:logging-config.xml' ja ...

  4. springboot启动时报错:Failed to load property source from location 'classpath:/application.yml'

    原因一 第一种可能是你的application.yml文件编码格式有问题,改为UTF-8,如下: 原因二 第二种可能就是你的application.yml文件是通过把其他类型的文件后缀名直接改为yml ...

  5. SpringBoot启动报错Could not resolve placeholder ‘XXX.XXX‘ in value

    SpringBoot启动项目时报错: Exception encountered during context initialization - cancelling refresh attempt: ...

  6. springboot启动报错:Unregistering JMX-exposed beans on shutdown

    环境 1,maven 3.5.0 2,eclipse 4.7.1 3,spring boot 1.5.9.RELEASE springboot启动报错 按照spring 用户手册创建新的spring ...

  7. 关于cmake从GitHub上下载的源码启动时报错的问题

    关于cmake从GitHub上下载的源码启动时报错的问题: 由于cmake会产生all_build和zero_check两个project,此时需要右击鼠标将需要运行的项目设为启动项,在进行编译,现只 ...

  8. linux重启was控制台报错,IHS启动时报错,从was控制台传播插件失败

    IHS启动时报错,从was控制台传播插件失败 集群IHS+WAS,以前单独访问某一个节点http://ip:9080可以访问,最近无法访问(9080可以telnet通),通过日志发现,以下问题请各前辈 ...

  9. 启动Spring项目报错,Springboot启动报错 Disconnected from the target VM 解决过程

    启动Spring项目报错,Springboot启动报错 Disconnected from the target VM 解决过程 大概率是缺少了一下依赖 <dependency><g ...

  10. SpringBoot启动报错:HikariPool-1 - Exception during pool initialization.解决办法

    SpringBoot启动报错:HikariPool-1 - Exception during pool initialization. 记一次Maven项目部署http访问mysql数据库过程中的问题 ...

最新文章

  1. 判断一件事有无技术含量的标准
  2. 关于ORA-06508 , ORA-04068异常的详细说明
  3. 两个listmap合并去重_我是如何用单机实现亿级规模题库去重的?
  4. 趣学车签约神策数据,数据赋能学车“新体验”
  5. 物理化学 热力学第一定律的概念
  6. iOS KVO crash 自修复技术实现与原理解析
  7. MySQL(16)--- DELETE 语句
  8. js两个日期对比大小
  9. 多核Cache一致性 伪共享 atomic的实现和cache相关的部分
  10. VM14无法将网络更改为桥接状态:没有未桥接的主机网络适配器
  11. 网络文件夹共享服务器,五个最佳网络文件共享服务
  12. Android Binder总结(转自Cloud Chou's Tech Blog)
  13. 你想成为一个什么样的人
  14. 阿里云centos下载地址
  15. OpenHarmony OpenSl ES音频播放开发
  16. Java语言与C语言的区别
  17. numeric_limits用法
  18. 好文章要收藏_漫谈IT毕业生职业规划
  19. php面试题之PHP核心技术(life)
  20. python05——摩尔斯电码

热门文章

  1. 转载:无刷直流电机的基本工作原理是什么
  2. win10如何在当前目录打开cmd窗口
  3. 处理debian7下Juk导入音乐乱码
  4. IDEA乱码解决合集
  5. 下载慢怎么办?(域名遭到dns污染处理方法)
  6. EDGE浏览器打开网页缓慢解决
  7. 计算机论文英文摘要范文,毕业论文英文摘要范文三篇
  8. 移动端日历---纯**自己写的
  9. cmd修改dns服务器,如何通过cmd修改dns图解教程
  10. php 改变页面背景颜色,PHP改变背景颜色