|
本帖最后由 马云龙 于 2022-8-31 15:45 编辑
先说配置,order服务模块没改动server:
port: 5001
spring:
application:
name: seata-order
main:
allow-bean-definition-overriding: true
datasource:
dynamic:
seata: true # 开启对 seata的支持
seata-mode: AT #支持XA及AT模式,默认AT
datasource:
# 设置 账号数据源配置
order:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/jeecg_order?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useSSL=false
username: root
password: root
schema: classpath:sql/schema-order.sql
seata:
enable-auto-data-source-proxy: false
service:
grouplist:
default: 127.0.0.1:8091
vgroup-mapping:
springboot-seata-group: default
# seata 事务组编号 用于TC集群名
tx-service-group: springboot-seata-groupseata配置文件只改了mode这块
## transaction log store, only used in seata-server
store {
## store mode: file、db、redis
mode = "db"
## file store property
file {
## store location dir
dir = "sessionStore"
# branch session size , if exceeded first try compress lockkey, still exceeded throws exceptions
maxBranchSessionSize = 16384
# globe session size , if exceeded throws exceptions
maxGlobalSessionSize = 512
# file buffer size , if exceeded allocate new buffer
fileWriteBufferCacheSize = 16384
# when recover batch read size
sessionReloadReadSize = 100
# async, sync
flushDiskMode = async
}
## database store property
db {
## the implement of javax.sql.DataSource, such as DruidDataSource(druid)/BasicDataSource(dbcp)/HikariDataSource(hikari) etc.
datasource = "druid"
## mysql/oracle/postgresql/h2/oceanbase etc.
dbType = "mysql"
driverClassName = "com.mysql.jdbc.Driver"
url = "jdbc:mysql://127.0.0.1:3306/seata"
user = "root"
password = "root"
minConn = 5
maxConn = 100
globalTable = "global_table"
branchTable = "branch_table"
lockTable = "lock_table"
queryLimit = 100
maxWait = 5000
}
## redis store property
redis {
host = "127.0.0.1"
port = "6379"
password = ""
database = "0"
minConn = 1
maxConn = 10
maxTotal = 100
queryLimit = 100
}
}
seata windows启动正常
然后后台order模块启动时一直说我的数据源连接问题,起不来,有没有同道知道怎么解决的?
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).
Disconnected from the target VM, address: '127.0.0.1:50188', transport: 'socket'
Process finished with exit code 1
|
|