这个是我的bootstrap.yml文件配置
spring:
profiles:
active: @profile.name@
cloud:
nacos:
config:
# Nacos 认证用户
username: @config.username@
# Nacos 认证密码
password: @config.password@
# 命名空间 常用场景之一是不同环境的配置的区分隔离,例如开发测试环境和生产环境的资源(如配置、服务)隔离等
namespace: @config.namespace@
# 配置中心地址
server-addr: @config.server-addr@
# 配置对应的分组
group: @config.group@
# 配置文件后缀
file-extension: yaml
# prefix: ''
refresh-enabled: true
discovery:
namespace: @config.namespace@
server-addr: @config.server-addr@
watch:
enabled: false
username: @config.username@
password: @config.password@
这个是报错文件
group[DEFAULT_GROUP]
2022-02-08 10:51:15.500 [main] INFO com.alibaba.nacos.client.config.utils.JvmUtil:49 - isMultiInstance:false
2022-02-08 10:51:15.566 [main] INFO o.s.c.b.c.PropertySourceBootstrapConfiguration:112 - Located property source: [BootstrapPropertySource {name='bootstrapProperties-test1-prod.yaml,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-test1.yaml(指定的配置文件),DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-test1,DEFAULT_GROUP'}]
2022-02-08 10:51:15.870 [main] INFO com.shenyue.collectionpro.CollectionProApplication:655 - The following profiles are active: prod
2022-02-08 10:51:20.068 [main] INFO o.springframework.cloud.context.scope.GenericScope:295 - BeanFactory id=1ff5477b-c33c-3eb5-83ee-fef1bf3e88e5
2022-02-08 10:51:22.824 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer:108 - Tomcat initialized with port(s): 8082 (http)
2022-02-08 10:51:23.146 [main] INFO org.apache.coyote.http11.Http11NioProtocol:173 - Initializing ProtocolHandler ["http-nio-8082"]
2022-02-08 10:51:23.147 [main] INFO org.apache.catalina.core.StandardService:173 - Starting service [Tomcat]
2022-02-08 10:51:23.147 [main] INFO org.apache.catalina.core.StandardEngine:173 - Starting Servlet engine: [Apache Tomcat/9.0.39]
2022-02-08 10:51:23.952 [main] INFO o.a.c.c.C.[Tomcat].[localhost].[/collection-pro]:173 - Initializing Spring embedded WebApplicationContext
2022-02-08 10:51:23.952 [main] INFO o.s.b.w.s.c.ServletWebServerApplicationContext:285 - Root WebApplicationContext: initialization completed in 7925 ms
2022-02-08 10:51:25.452 [main] WARN com.netflix.config.sources.URLConfigurationSource:121 - No URLs will be polled as dynamic configuration sources.
2022-02-08 10:51:25.453 [main] INFO com.netflix.config.sources.URLConfigurationSource:122 - To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2022-02-08 10:51:25.539 [main] WARN com.netflix.config.sources.URLConfigurationSource:121 - No URLs will be polled as dynamic configuration sources.
2022-02-08 10:51:25.539 [main] INFO com.netflix.config.sources.URLConfigurationSource:122 - To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2022-02-08 10:51:26.046 [main] INFO o.s.scheduling.concurrent.ThreadPoolTaskExecutor:181 - Initializing ExecutorService 'applicationTaskExecutor'
2022-02-08 10:51:26.676 [main] INFO o.s.scheduling.concurrent.ThreadPoolTaskScheduler:181 - Initializing ExecutorService 'taskScheduler'
2022-02-08 10:51:26.871 [main] INFO org.apache.coyote.http11.Http11NioProtocol:173 - Starting ProtocolHandler ["http-nio-8082"]
2022-02-08 10:51:26.962 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer:220 - Tomcat started on port(s): 8082 (http) with context path '/collection-pro'
2022-02-08 10:51:26.969 [main] WARN com.shenyue.collectionpro.mdb.convert.DBConvert:152 -
2022-02-08 10:51:26.980 [main] INFO com.alibaba.nacos.client.naming:64 - initializer namespace from System Property :null
2022-02-08 10:51:26.982 [main] INFO com.alibaba.nacos.client.naming:73 - initializer namespace from System Environment :null
2022-02-08 10:51:26.983 [main] INFO com.alibaba.nacos.client.naming:83 - initializer namespace from System Property :null
2022-02-08 10:51:27.137 [main] INFO com.alibaba.nacos.client.naming:81 - [BEAT] adding beat: BeatInfo{port=8082, ip='192.168.1.88', weight=1.0, serviceName='DEFAULT_GROUP@@lingbozhnaoyang', cluster='DEFAULT', metadata={preserved.register.source=SPRING_CLOUD}, scheduled=false, period=5000, stopped=false} to beat map.
2022-02-08 10:51:27.138 [main] INFO com.alibaba.nacos.client.naming:223 - [REGISTER-SERVICE] material registering service DEFAULT_GROUP@@lingbozhnaoyang with instance: Instance{instanceId='null', ip='192.168.1.88', port=8082, weight=1.0, healthy=true, enabled=true, ephemeral=true, clusterName='DEFAULT', serviceName='null', metadata={preserved.register.source=SPRING_CLOUD}}
2022-02-08 10:51:27.149 [main] INFO c.a.cloud.nacos.registry.NacosServiceRegistry:71 - nacos registry, DEFAULT_GROUP lingbozhnaoyang 192.168.1.88:8082 register finished
2022-02-08 10:51:27.248 [main] INFO com.shenyue.collectionpro.CollectionProApplication:61 - Started CollectionProApplication in 30.075 seconds (JVM running for 58.115)
2022-02-08 10:51:27.257 [main] WARN com.shenyue.collectionpro.CollectionProApplication:26 : 《配置文件名称:test2》
我是用windows注册成服务的下面是我指定配置的文件
<service>
<!-- ID of the service. It should be unique across the Windows system-->
<id>collection-pro</id>
<!-- Display name of the service -->
<name>注册的服务名</name>
<!-- Service description -->
<description>This service is a service created from a minimal configuration</description>
<!-- Path to the executable, which should be started -->
<executable>C:\java\jre1.8.0_191\bin\java</executable>
<arguments>-Xmx1024m -Dfile.encoding=utf-8 -jar collection-pro.jar <!--
MIT License
<service>
<!-- ID of the service. It should be unique across the Windows system-->
<id>collection-pro</id>
<!-- Display name of the service -->
<name>注册的服务名</name>
<!-- Service description -->
<description>This service is a service created from a minimal configuration</description>
<!-- Path to the executable, which should be started -->
<executable>C:\java\jre1.8.0_191\bin\java</executable>
<arguments>-Xmx1024m -Dfile.encoding=utf-8 -jar collection-pro.jar --spring.application.name="心跳名称指定" --spring.cloud.nacos.config.prefix="指定的配置文件"</arguments>
</service>
"</arguments>
</service>
**各位同学请指教,如果需要补充欢迎评论。
万分感谢 **