seata服务端版本是1.5.2,client端引用seata版本1.5.2,spring版本5.2.8.RELEASE,服务端启动正常,启动client端时报错,麻烦大佬帮忙看看

tjrkku2a  于 2022-12-31  发布在  Spring
关注(0)|答案(6)|浏览(347)

1.seata服务端版本是1.5.2,seata client版本1.5.2,spring版本5.2.8.RELEASE,spring boot版本2.3.2.RELEASE,服务端启动正常,启动client端时报错,错误如下:

APPLICATION FAILED TO START

Description:

Configuration property name 'seata.transport.rpcRmRequestTimeout' is not valid:

Invalid characters: 'R', 'R', 'T'
Reason: Canonical names should be kebab-case ('-' separated), lowercase alpha-numeric characters and must start with a letter

Action:

Modify 'seata.transport.rpcRmRequestTimeout' so that it conforms to the canonical names requirements.

2022-07-22 10:51:57.771 ERROR 19252 --- [ main] o.s.boot.SpringApplication : Application run failed

org.springframework.boot.context.properties.source.InvalidConfigurationPropertyNameException: Configuration property name 'seata.transport.rpcRmRequestTimeout' is not valid
at org.springframework.boot.context.properties.source.ConfigurationPropertyName.elementsOf(ConfigurationPropertyName.java:565) ~[spring-boot-2.3.2.RELEASE.jar:2.3.2.RELEASE]
at org.springframework.boot.context.properties.source.ConfigurationPropertyName.elementsOf(ConfigurationPropertyName.java:542) ~[spring-boot-2.3.2.RELEASE.jar:2.3.2.RELEASE]
at org.springframework.boot.context.properties.source.ConfigurationPropertyName.of(ConfigurationPropertyName.java:533) ~[spring-boot-2.3.2.RELEASE.jar:2.3.2.RELEASE]
at org.springframework.boot.context.properties.source.ConfigurationPropertyName.of(ConfigurationPropertyName.java:510) ~[spring-boot-2.3.2.RELEASE.jar:2.3.2.RELEASE]
at org.springframework.boot.context.properties.migrator.PropertiesMigrationReporter.lambda$null$1(PropertiesMigrationReporter.java:103) ~[spring-boot-properties-migrator-2.3.2.RELEASE.jar:2.3.2.RELEASE]
at java.util.ArrayList.forEach(ArrayList.java:1259) ~[na:1.8.0_301]
at org.springframework.boot.context.properties.migrator.PropertiesMigrationReporter.lambda$getMatchingProperties$2(PropertiesMigrationReporter.java:101) ~[spring-boot-properties-migrator-2.3.2.RELEASE.jar:2.3.2.RELEASE]
at java.util.LinkedHashMap.forEach(LinkedHashMap.java:684) ~[na:1.8.0_301]
2.client端seata依赖如下:

io.seata
seata-spring-boot-starter
1.5.2

com.alibaba.cloud
spring-cloud-starter-alibaba-seata
2.2.1.RELEASE

io.seata
seata-spring-boot-starter

3.服务端配置放在nacos,如下:

4.client应用配置如下:
seata:
enabled: true
application-id: order-at-example
tx-service-group: my-tx-group # 事务群组(可以每个应用独立取名,也可以使用相同的名字)
registry:
type: nacos
nacos:
application: seata-server
group: SEATA_GROUP
server-addr: ${NACOS_SERVER_ADDR:127.0.0.1:8848}
namespace: ${NACOS_NAMESPACE:seata152}
#cluster: default
config:
type: nacos
nacos:
namespace: ${NACOS_NAMESPACE:seata152}
server-addr: ${NACOS_SERVER_ADDR:127.0.0.1:8848}
group: SEATA_GROUP
data-id: seataServer.properties

9bfwbjaz

9bfwbjaz1#

应该是没读到nacos的配置,读了本地的这个配置,本地是驼峰还是-?看到是seata开头的,高版本spring是不支持驼峰了,你是不是yml里配置了驼峰样式的配置

bybem2ql

bybem2ql2#

你好,我本地服务的yml文件没有配置seata.transport.rpcRmRequestTimeout 搜索本地yml配置文件,并没有配置,如附件截图所示 发件人: FUNKYE ***@***.***> 发送时间: 2022年7月22日 11:32 收件人: seata/seata ***@***.***> 抄送: 刘军林 ***@***.***>; Author ***@***.***> 主题: [External Sender]Re: [seata/seata] seata服务端版本是1.5.2,client端引用seata版本1.5.2,spring版本5.2.8.RELEASE,服务端启动正常,启动client端时报错,麻烦大佬帮忙看看 (Issue #4801) 应该是没读到nacos的配置,读了本地的这个配置,本地是驼峰还是-?看到是seata开头的,高版本spring是不支持驼峰了,你是不是yml里配置了驼峰样式的配置 — Reply to this email directly, view it on GitHub<#4801 (comment)>, or unsubscribe< https://github.com/notifications/unsubscribe-auth/A2FRCMW54SDQ7ETUY4IBRQLVVII3ZANCNFSM54JWPT4Q >. You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>

e7arh2l6

e7arh2l63#

@liujunlin-2022 或许你应该检查一下你应用侧在nacos上的配置

xfb7svmp

xfb7svmp4#

@liujunlin-2022 或许你应该检查一下你应用侧在nacos上的配置

nacos的配置我直接从1.5.2里面config.txt文件拷贝的
#For details about configuration items, see https://seata.io/zh-cn/docs/user/configurations.html
#Transport configuration, for client and server
transport.type=TCP
transport.server=NIO
transport.heartbeat=true
transport.enableTmClientBatchSendRequest=false
transport.enableRmClientBatchSendRequest=true
transport.enableTcServerBatchSendResponse=false
transport.rpcRmRequestTimeout=30000
transport.rpcTmRequestTimeout=30000
transport.rpcTcRequestTimeout=30000
transport.threadFactory.bossThreadPrefix=NettyBoss
transport.threadFactory.workerThreadPrefix=NettyServerNIOWorker
transport.threadFactory.serverExecutorThreadPrefix=NettyServerBizHandler
transport.threadFactory.shareBossWorker=false
transport.threadFactory.clientSelectorThreadPrefix=NettyClientSelector
transport.threadFactory.clientSelectorThreadSize=1
transport.threadFactory.clientWorkerThreadPrefix=NettyClientWorkerThread
transport.threadFactory.bossThreadSize=1
transport.threadFactory.workerThreadSize=default
transport.shutdown.wait=3
transport.serialization=seata
transport.compressor=none

#Transaction routing rules configuration, only for the client
service.vgroupMapping.default_tx_group=default
#If you use a registry, you can ignore it
service.default.grouplist=127.0.0.1:8091
service.enableDegrade=false
service.disableGlobalTransaction=false

#Transaction rule configuration, only for the client
client.rm.asyncCommitBufferLimit=10000
client.rm.lock.retryInterval=10
client.rm.lock.retryTimes=30
client.rm.lock.retryPolicyBranchRollbackOnConflict=true
client.rm.reportRetryCount=5
client.rm.tableMetaCheckEnable=true
client.rm.tableMetaCheckerInterval=60000
client.rm.sqlParserType=druid
client.rm.reportSuccessEnable=false
client.rm.sagaBranchRegisterEnable=false
client.rm.sagaJsonParser=fastjson
client.rm.tccActionInterceptorOrder=-2147482648
client.tm.commitRetryCount=5
client.tm.rollbackRetryCount=5
client.tm.defaultGlobalTransactionTimeout=60000
client.tm.degradeCheck=false
client.tm.degradeCheckAllowTimes=10
client.tm.degradeCheckPeriod=2000
client.tm.interceptorOrder=-2147482648
client.undo.dataValidation=true
client.undo.logSerialization=jackson
client.undo.onlyCareUpdateColumns=true
server.undo.logSaveDays=7
server.undo.logDeletePeriod=86400000
client.undo.logTable=undo_log
client.undo.compress.enable=true
client.undo.compress.type=zip
client.undo.compress.threshold=64k
#For TCC transaction mode
tcc.fence.logTableName=tcc_fence_log
tcc.fence.cleanPeriod=1h

#Log rule configuration, for client and server
log.exceptionRate=100

#Transaction storage configuration, only for the server. The file, DB, and redis configuration values are optional.
store.mode=file
store.lock.mode=file
store.session.mode=file
#Used for password encryption
store.publicKey=

#If store.mode,store.lock.mode,store.session.mode are not equal to file , you can remove the configuration block.
store.file.dir=file_store/data
store.file.maxBranchSessionSize=16384
store.file.maxGlobalSessionSize=512
store.file.fileWriteBufferCacheSize=16384
store.file.flushDiskMode=async
store.file.sessionReloadReadSize=100

#These configurations are required if the store mode is db . If store.mode,store.lock.mode,store.session.mode are not equal to db , you can remove the configuration block.
store.db.datasource=druid
store.db.dbType=mysql
store.db.driverClassName=com.mysql.jdbc.Driver
store.db.url=jdbc:mysql://127.0.0.1:3306/seata?useUnicode=true&rewriteBatchedStatements=true
store.db.user=username
store.db.password=password
store.db.minConn=5
store.db.maxConn=30
store.db.globalTable=global_table
store.db.branchTable=branch_table
store.db.distributedLockTable=distributed_lock
store.db.queryLimit=100
store.db.lockTable=lock_table
store.db.maxWait=5000

#These configurations are required if the store mode is redis . If store.mode,store.lock.mode,store.session.mode are not equal to redis , you can remove the configuration block.
store.redis.mode=single
store.redis.single.host=127.0.0.1
store.redis.single.port=6379
store.redis.sentinel.masterName=
store.redis.sentinel.sentinelHosts=
store.redis.maxConn=10
store.redis.minConn=1
store.redis.maxTotal=100
store.redis.database=0
store.redis.password=
store.redis.queryLimit=100

#Transaction rule configuration, only for the server
server.recovery.committingRetryPeriod=1000
server.recovery.asynCommittingRetryPeriod=1000
server.recovery.rollbackingRetryPeriod=1000
server.recovery.timeoutRetryPeriod=1000
server.maxCommitRetryTimeout=-1
server.maxRollbackRetryTimeout=-1
server.rollbackRetryTimeoutUnlockEnable=false
server.distributedLockExpireTime=10000
server.xaerNotaRetryTimeout=60000
server.session.branchAsyncQueueSize=5000
server.session.enableBranchAsyncRemove=false
server.enableParallelRequestHandle=false

#Metrics configuration, only for the server
metrics.enabled=false
metrics.registryType=compact
metrics.exporterList=prometheus
metrics.exporterPrometheusPort=9898

c90pui9n

c90pui9n5#

我指的是你应用侧的配置,并不是seata的配置。 应用侧你也用了nacos,明显是springboot读取nacos配置时出现了问题

yc0p9oo0

yc0p9oo06#

看看是否 namespace的原因

相关问题