项目场景:
在使用mybatis联合德鲁伊ue4进行登录组件的搭建的时候出现报错信息
问题描述
无法进行数据源的驱动读取
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
原因分析:
进行分析与查证后验证为是整个德鲁伊数据池的配置都不进行自补全,推断格式或依赖出现问题.
解决方案:
切实保证依赖正确的前提下进行配置缩进的检查最终发现是缩进出现问题,将缩进调整为正常格式,代码可以进行正常运行.
spring:
datasource:
#数据库的访问配置,使用德鲁伊的数据源
type: com.alibaba.druid.pool.DruidDataSource
druid:
url: jdbc:mysql://localhost:3306/mybatis?rewriteBatchedStatements=true
username: root
password: 123456
# 连接池配置:大小,最小,最大
initial-size: 1
min-idle: 1
max-active: 20
#启用Restful风格访问
driver-class-name: com.mysql.cj.jdbc.Driver
mvc:
path match:
matching-strategy: ant_path_matcher
hidden-method:
filter:
enabled: true
web:
resources:
static-locations: classpath:/
#mybatis配置
mybatis:
mapper-locations: classpath:mapper/*.xml
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
server:
port: 8080
servlet:
encoding:
charset: utf-8
enabled: true
force: true
本文档记录了在UE4项目中搭建登录系统时遇到的一个bug,问题源于德鲁伊数据池配置的自补全失效。经过分析,确认是配置文件的缩进不正确导致。解决方案是仔细检查并修正配置文件的缩进格式,恢复正常运行。
1638

被折叠的 条评论
为什么被折叠?



