null指针异常

scyqe7ek  于 2021-06-09  发布在  Redis
关注(0)|答案(0)|浏览(377)

我试图连接到redis服务器使用配置从外部yaml文件,但我得到空指针异常。请帮助解决此问题:

Config config = Config.fromYAML( redisConnection.getClass().getResource( "redisson-config.yml" ).getFile( ) );

redisson-config.yml文件

singleServerConfig:
  idleConnectionTimeout: 10000
  connectTimeout: 10000
  timeout: 3000
  retryAttempts: 3
  retryInterval: 1500
  password: null
  subscriptionsPerConnection: 5
  clientName: null
  address: "redis://localhost:6379"
  subscriptionConnectionMinimumIdleSize: 1
  subscriptionConnectionPoolSize: 50
  connectionMinimumIdleSize: 24
  connectionPoolSize: 64
  database: 0
  dnsMonitoringInterval: 5000
threads: 16
nettyThreads: 32
codec: !<org.redisson.codec.FstCodec> {}
transportMode: "NIO"

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题