使用spring cloud tencent的时候,服务注册到polaris报错:This service instance will not be registered

提问者:帅平 问题分类:微服务
今天尝试练手spring cloud tencent的微服务框架,结果在服务注册的时候报错了,提示:
This service instance will not be registered, because it is not a servlet-based or reactive web application.

请问这个怎么解决,配置文件示例和官网一样,如下:
spring:
  application:
    name: user-service
  cloud:
    polaris:
      address: grpc://192.168.31.218:8091
      namespace: shop

配置信息是放在bootstrap里面的。
1 个回答
理解的心
理解的心
这是因为当前项目不是一个web项目,如果是springboot项目的话,建议检查下收否引入下面这个包:
<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>
发布于:1年前 (2023-05-10) IP属地:四川省
帅平
帅平提问者
确实忘记了添加,赞!!!
发布于:1年前 (2023-05-10) IP属地:四川省
我来回答