关于druid与springboot版本问题
datasource:
druid:
driver-class-name: ${sky.datasource.driver-class-name}
url: jdbc:mysql://${sky.datasource.host}:${sky.datasource.port}/${sky.datasource.database}?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
username: ${sky.datasource.username}
password: ${sky.datasource.password}
上述是黑马程序员苍穹外卖的yml里的druid配置,我复制在另一个项目的时候报错
Description:
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).
Process finished with exit code 1
后来发现是因为我新的项目用的是springboot3,而这个老项目用的2,很多人都说降版本可以解决,当然也可以改成下面:将druid放在type里
datasource:
driver-class-name: ${datasource.driver-class-name}
url: jdbc:mysql://${datasource.host}:${datasource.port}/${datasource.database}?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
username: ${datasource.username}
password: ${datasource.password}
type: com.alibaba.druid.pool.DruidDataSource
关于druid与springboot版本问题的更多相关文章
- alibaba druid 在springboot start autoconfig 下的bug
alibaba druid 在springboot start autoconfig下的bug 标签(空格分隔):druid springboot start autoconfig 背景 发现.分析过 ...
- SpringCloud 与 SpringBoot版本问题
如果SpringBoot版本与SpringCloud版本不一致,SpringBoot应用启动会报错: 解决方案: 版本对应关系可以在 https://start.spring.io/info 上查看: ...
- Spring Cloud Alibaba (一): SpringCloud与SpringBoot版本选型
前言 近年SpringCloud与SpringBoot更新迭代非常频繁,导致我们对两者的版本选型非常的困难.若是版本选择有问题, 会导致开发中调试兼容性占用非常多的得必要时间. SpringClo ...
- 升级了Springboot版本后项目启动不了了
问题背景 项目上使用的springboot版本是2.1.1.RELEASE,现在因为要接入elasticsearch7.x版本,参考官方文档要求,需要将springboot版本升级到2.5.14. 本 ...
- session共享问题、springboot 版本不统一问题
问题:按照正常的程序将session 共享引入工程,但是一直取不到 原因:springboot 的版本不同导致,存session的springboot 用的是springboot1.5.6,而取ses ...
- 【SpringBoot | Druid】SpringBoot整合Druid
SpringBoot整合Druid Druid是个十分强大的后端管理工具,具体的功能和用途请问阿里爸爸 1. 在pom.xml中导入包 <!-- alibaba 的druid数据库连接池 --& ...
- 使用Druid作为SpringBoot项目数据源(添加监控)
Druid是一个关系型数据库连接池,它是阿里巴巴的一个开源项目.Druid支持所有JDBC兼容数据库,包括了Oracle.MySQL.PostgreSQL.SQL Server.H2等.Druid在监 ...
- 微信扫码支付springboot版本
发布时间:2018-11-06 技术:springboot+freemarker 概述 该项目是一个采用springboot构建的web项目,主要实现了微信扫码支付功能.包含最基本的创建订单, ...
- Springboot 版本+ jdk 版本 + Maven 版本的匹配
Spring boot 版本 Spring Framework jdk 版本 maven 版本 1.2.0 版本之前 6 3.0 1.2.0 4.1.3+ 6 3.2+ 1.2.1 4.1.3+ 7 ...
- Springboot 版本+ jdk 版本 + Maven 版本的对应关系
Spring boot 版本 Spring Framework jdk 版本 maven 版本 1.2.0 版本之前 6 3.0 1.2.0 4.1.3+ 6 3.2+ 1.2.1 4.1.3+ ...
随机推荐
- Android 12(S) MultiMedia Learning(八)NuPlayer Renderer
NuPlayer的AVSync由Renderer实现,接下来主要来看AVSync的工作原理 相关代码位置: NuPlayerRenderer.cpp - OpenGrok cross referenc ...
- 你好Avalonia框架
https://docs.avaloniaui.net/docs/getting-started/ 起因公司事业部是做移动等营业厅办理相关业务,无纸化系统的.简单的说就是以前去营业厅办理业务都需要各种 ...
- 使用Rainbond部署Logikm,轻松管理Kafka集群
简介 滴滴Logi-KafkaManager脱胎于滴滴内部多年的Kafka运营实践经验,是面向Kafka用户.Kafka运维人员打造的共享多租户Kafka云平台.专注于Kafka运维管控.监控告警.资 ...
- 一文带你理解透MyBatis源码
本文分享自华为云社区<一文彻底吃透MyBatis源码!!>,作者:冰 河. 写在前面 随着互联网的发展,越来越多的公司摒弃了Hibernate,而选择拥抱了MyBatis.而且,很多大厂在 ...
- react 利用高阶组件给页面加上动画
利用高阶组件给页面加上动画 并不想让所有的路由都有动画效果,只是想对指定的页面有路由切换效果,可以利用高阶组件来完成. # 定义高阶组件 import React, { Component } fro ...
- DoNet Core的启动过程-WebApplicationBuilder
1.前言 在NET6开始做ASP.NETCore的开发,我们首先要看的是启动过程,而WebApplication和WebApplicationBuilder 类是启动过程好不开的类,WebApplic ...
- windows 批处理 检查并启动 windows 服务
windows 批处理 检查并启动 windows 服务 set srvname="YSWindowsService" sc query|find %srvname% && ...
- C# .NET 云南农信国密签名(SM2)简要解析
BouncyCastle库(BC库)与云南农信最大的区别是 : BC库 SM2Signer.Init() 方法比云南农信多了最后3行代码: digest.Reset(); z = GetZ(user ...
- Ubuntu 更改鼠标滚轮速度
1.安装imwheel sudo apt-get install imwheel 2.更改配置 sudo gedit ~/.imwheelrc 输入以下内容: ".*"None, ...
- 引入feign注入报错 org.springframework.beans.factory.NoSuchBeanDefinitionException解决
引入feign注入报错 org.springframework.beans.factory.NoSuchBeanDefinitionException解决 [172.16.22.215] out: C ...