记录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. python udp 直播_[Python] socket发送UDP广播实现聊天室功能
  2. 《信息安全研究》数据安全专刊研讨会召开
  3. Angular19 自定义表单控件
  4. 基础练习 FJ的字符串
  5. xml在线解析_python-jsonpath 解析神器
  6. 华为鲲鹏arm架构linux服务器安装mysql教程
  7. 前端学习(2056):初识vue.js
  8. Dialog的半透明背景的灰度
  9. [Chrome插件] SelectJd(京东自营筛选器) v1.0.0 发布
  10. hihocoder-1498-Diligent Robots
  11. python lncrna_使用CPAT分析lncRNA
  12. 90个外国英文网站强力推荐!!!
  13. 成都旅游住宿购物交通攻略87
  14. [计算机漫谈]网络初步:一个分组的生命历程
  15. DSP总结之C语言环境
  16. 十进制转换为二、十六进制的方法
  17. vue简单实现吸顶效果pc
  18. Python中的多行输入
  19. lightoj刷题日记
  20. 情人节你应该会用到 【表白 告白】

热门文章

  1. JS正则:按中英文逗号 中英文分号 回车 空格分隔/切割字符串
  2. 全球最大智慧集装箱码头如何做到“空无一人”?
  3. java 金字塔 2的幂_三角形数(金字塔三角形数量公式)
  4. mysql中如何复制数据表_MySQL中快速复制数据表方法汇总
  5. Tomcat SSL配置 Connector attribute SSLCertificateFile must be defined when using SSL with APR解决 作者:孤风一
  6. box-sizing与盒模型
  7. (判断题)两台路由器之间转发的数据包一定不携带VLAN TAG?
  8. 智能制造-从愿景到实现路径
  9. arcgis中的图像裁剪
  10. 哇!大开脑洞!“绿协杯”东莞市第六届绿色建筑设计比赛【往期获奖作品回顾上篇】