Param 'serviceName' is illegal, serviceName is blank

1,668 阅读1分钟

1.问题详细:

namingService subscribe failed, properties:NacosDiscoveryProperties{serverAddr='localhost:8848', username='', password='', endpoint='', namespace='', watchDelay=30000, logName='', service='', weight=1.0, clusterName='DEFAULT', group='DEFAULT_GROUP', namingLoadCacheAtStart='false', metadata={preserved.register.source=SPRING_CLOUD}, registerEnabled=true, ip='192.168.11.1', networkInterface='', port=-1, secure=false, accessKey='', secretKey='', heartBeatInterval=null, heartBeatTimeout=null, ipDeleteTimeout=null, instanceEnabled=true, ephemeral=true, failureToleranceEnabled=false}, ipDeleteTimeout=null, failFast=true}

2.原因:

在application.yml中缺少nacos识别的必要参数

3.解决方法:

spring: 
  application: 
    name: test
  cloud: 
    nacos: 
      discovery: 
        server-addr: localhost:8848

maven引用没问题的情况下, 出现以上报错, 第一时间检查application namenacos服务地址配置