Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The service running from eclipse can not be registered to nacos server. #3924

Closed
pei-han opened this issue Dec 13, 2024 · 5 comments
Closed

Comments

@pei-han
Copy link

pei-han commented Dec 13, 2024

Which Component
Spring boot 3,spring 6,spring cloud alibaba 2023.0.1.2,nacos server 2.3.0-beta

Describe the bug
The service running from eclipse can not be registered to nacos server.
There is no REGISTER-SERVICE key word infomation in the log from eclipse console.
However use command mvn spring-boot:run -pl ruoyi-gateway -Pspringboot3remote or java -jar to run the service,print these logs
15:15:54.119 [main] INFO c.a.n.client.naming - [registerService,133] - [REGISTER-SERVICE] springboot3remote registering service ruoyi-gateway with instance Instance{instanceId='null', ip='169.254.116.234', port=8080, weight=1.0, healthy=true, enabled=true, ephemeral=true, clusterName='', serviceName='null', metadata={IPv6=[240e:441:418:8db4:7763:b96b:19b6:2f7d], preserved.register.source=SPRING_CLOUD}}
and the service can be registered to nacos server.

Simplest demo

To Reproduce
Use command mvn spring-boot:run -pl ruoyi-gateway -Pspringboot3remote or java -jar to run the service,
then the service can be registered to nacos server.
But eclipse can register service to nacos server.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
nacos discovery configuration and namespace configuration below
image
image

Additional context
window 11 , jdk 17

Any suggest, i'll appreciate that

@pei-han
Copy link
Author

pei-han commented Dec 13, 2024

Also it is ok in Linux os

@pei-han
Copy link
Author

pei-han commented Dec 13, 2024

The complete logs are here from Eclipse Console.

**15:53:35.144 [background-preinit] INFO o.h.v.i.util.Version - [,21] - HV000001: Hibernate Validator 8.0.1.Final
Spring Boot Version: 3.3.5
Spring Application Name: ruoyi-gateway

######## ###### ###### ### ######## ######## ## ## ### ##

## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##

## ## ## ## ## ## ## ## ## ## ## ## ##

## ## ## ####### ## #### ## ## ## ###### ## ## ## ## ##

## ## ## ## ## ######### ## ## ## ## ## #########

## ## ## ## ## ## ## ## ## ## ## ## ## ## ##

######## ###### ###### ## ## ## ######## ### ### ## ##

15:53:38.009 [main] INFO c.a.n.c.u.ParamUtil - [,89] - [settings] [req-serv] nacos-server port:8848
15:53:38.012 [main] INFO c.a.n.c.u.ParamUtil - [,92] - [settings] [http-client] connect timeout:1000
15:53:38.017 [main] INFO c.a.n.c.u.ParamUtil - [,97] - PER_TASK_CONFIG_SIZE: 3000.0
15:53:38.025 [Thread-2] INFO c.a.n.c.a.r.i.CredentialWatcher - [loadCredentialFromEnv,189] - null No credential found
15:53:38.422 [main] INFO c.a.n.common.labels - [getLabels,48] - DefaultLabelsCollectorManager get labels.....
15:53:38.424 [main] INFO c.a.n.common.labels - [getLabels,62] - Process LabelsCollector with [name:defaultNacosLabelsCollector]
15:53:38.425 [main] INFO c.a.n.common.labels - [collectLabels,62] - default nacos collect properties raw labels: null
15:53:38.428 [main] INFO c.a.n.common.labels - [collectLabels,69] - default nacos collect properties labels: {}
15:53:38.430 [main] INFO c.a.n.common.labels - [collectLabels,72] - default nacos collect jvm raw labels: null
15:53:38.431 [main] INFO c.a.n.common.labels - [collectLabels,78] - default nacos collect jvm labels: {}
15:53:38.432 [main] INFO c.a.n.common.labels - [collectLabels,81] - default nacos collect env raw labels: null
15:53:38.433 [main] INFO c.a.n.common.labels - [collectLabels,89] - default nacos collect env labels: {}
15:53:38.436 [main] INFO c.a.n.common.labels - [getLabels,50] - DefaultLabelsCollectorManager get labels finished,labels :{}
15:53:38.465 [main] INFO c.a.n.p.a.s.c.ClientAuthPluginManager - [init,56] - [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.impl.NacosClientAuthServiceImpl success.
15:53:38.467 [main] INFO c.a.n.p.a.s.c.ClientAuthPluginManager - [init,56] - [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.ram.RamClientAuthServiceImpl success.
15:53:38.583 [main] INFO c.a.n.c.c.i.Limiter - [,55] - limitTime:5.0
15:53:39.404 [main] INFO c.a.n.c.c.i.LocalConfigInfoProcessor - [,65] - LOCAL_SNAPSHOT_PATH:C:\Users\imcrazyforyou\nacos\config
15:53:39.415 [main] INFO c.a.n.c.r.client - [lambda$createClient$0,118] - [RpcClientFactory] create a new rpc client of 1ff58b31-2f19-4ef8-975f-e93aee0d58d1_config-0
15:53:39.472 [main] INFO c.a.n.c.r.client - [printIfInfoEnabled,63] - [1ff58b31-2f19-4ef8-975f-e93aee0d58d1_config-0] Register server push request handler:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$$Lambda$569/0x0000000800f75b50
15:53:39.473 [main] INFO c.a.n.c.r.client - [printIfInfoEnabled,63] - [1ff58b31-2f19-4ef8-975f-e93aee0d58d1_config-0] Register server push request handler:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$$Lambda$570/0x0000000800f75f70
15:53:39.475 [main] INFO c.a.n.c.r.client - [printIfInfoEnabled,63] - [1ff58b31-2f19-4ef8-975f-e93aee0d58d1_config-0] Registry connection listener to current client:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$1
15:53:39.478 [main] INFO c.a.n.c.r.client - [printIfInfoEnabled,63] - [1ff58b31-2f19-4ef8-975f-e93aee0d58d1_config-0] RpcClient init, ServerListFactory = com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$2
15:53:39.500 [main] INFO c.a.n.c.r.client - [printIfInfoEnabled,63] - [1ff58b31-2f19-4ef8-975f-e93aee0d58d1_config-0] Try to connect to server on start up, server: {serverIp = '172.18.18.91', server main port = 8848}
15:53:39.566 [main] INFO c.a.n.c.r.c.g.GrpcClient - [createNewManagedChannel,210] - grpc client connection server:172.18.18.91 ip,serverPort:9848,grpcTslConfig:{"sslProvider":"","enableTls":false,"mutualAuthEnable":false,"trustAll":false}
15:53:43.527 [main] INFO c.a.n.c.a.AbstractAbilityControlManager - [initAbilityTable,61] - Ready to get current node abilities...
15:53:43.531 [main] INFO c.a.n.c.a.AbstractAbilityControlManager - [initAbilityTable,89] - Ready to initialize current node abilities, support modes: [SDK_CLIENT]
15:53:43.532 [main] INFO c.a.n.c.a.AbstractAbilityControlManager - [initAbilityTable,94] - Initialize current abilities finish...
15:53:43.534 [main] INFO c.a.n.c.a.d.NacosAbilityManagerHolder - [initAbilityControlManager,85] - [AbilityControlManager] Successfully initialize AbilityControlManager
15:53:43.979 [main] INFO c.a.n.c.r.client - [printIfInfoEnabled,63] - [1ff58b31-2f19-4ef8-975f-e93aee0d58d1_config-0] Success to connect to server [172.18.18.91:8848] on start up, connectionId = 1734076619089_10.10.146.35_61234
15:53:43.981 [com.alibaba.nacos.client.remote.worker.0] INFO c.a.n.c.r.client - [printIfInfoEnabled,63] - [1ff58b31-2f19-4ef8-975f-e93aee0d58d1_config-0] Notify connected event to listeners.
15:53:43.981 [main] INFO c.a.n.c.r.client - [printIfInfoEnabled,63] - [1ff58b31-2f19-4ef8-975f-e93aee0d58d1_config-0] Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$ConnectResetRequestHandler
15:53:43.981 [com.alibaba.nacos.client.remote.worker.0] INFO c.a.n.c.c.i.ClientWorker - [onConnected,713] - [1ff58b31-2f19-4ef8-975f-e93aee0d58d1_config-0] Connected,notify listen context...
15:53:43.982 [main] INFO c.a.n.c.r.client - [printIfInfoEnabled,63] - [1ff58b31-2f19-4ef8-975f-e93aee0d58d1_config-0] Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$$Lambda$592/0x00000008010cf060
15:53:44.256 [main] INFO c.a.n.c.c.u.JvmUtil - [init,59] - isMultiInstance:false
15:53:44.645 [main] WARN c.a.c.n.c.NacosPropertySourceBuilder - [loadNacosData,97] - Ignore the empty nacos configuration and get it based on dataId[ruoyi-gateway] & group[DEFAULT_GROUP]
15:53:44.726 [main] WARN c.a.c.n.c.NacosPropertySourceBuilder - [loadNacosData,97] - Ignore the empty nacos configuration and get it based on dataId[ruoyi-gateway.yml] & group[DEFAULT_GROUP]
15:53:44.913 [main] INFO c.r.g.RuoYiGatewayApplication - [logStartupProfileInfo,660] - The following 1 profile is active: "prod"
15:53:49.541 [main] WARN o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - [postProcessAfterInitialization,429] - Bean 'org.springframework.cloud.client.loadbalancer.LoadBalancerAutoConfiguration$DeferringLoadBalancerInterceptorConfig' of type [org.springframework.cloud.client.loadbalancer.LoadBalancerAutoConfiguration$DeferringLoadBalancerInterceptorConfig] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). The currently created BeanPostProcessor [lbRestClientPostProcessor] is declared through a non-static factory method on that class; consider declaring it as static instead.
15:53:49.558 [main] WARN o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - [postProcessAfterInitialization,437] - Bean 'deferringLoadBalancerInterceptor' of type [org.springframework.cloud.client.loadbalancer.DeferringLoadBalancerInterceptor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected/applied to a currently created BeanPostProcessor [lbRestClientPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies/advisors. If this bean does not have to be post-processed, declare it with ROLE_INFRASTRUCTURE.
15:53:49.575 [main] WARN o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - [postProcessAfterInitialization,429] - Bean 'org.springframework.cloud.client.loadbalancer.reactive.LoadBalancerBeanPostProcessorAutoConfiguration' of type [org.springframework.cloud.client.loadbalancer.reactive.LoadBalancerBeanPostProcessorAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). The currently created BeanPostProcessor [loadBalancerWebClientBuilderBeanPostProcessor] is declared through a non-static factory method on that class; consider declaring it as static instead.
15:53:49.581 [main] WARN o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - [postProcessAfterInitialization,437] - Bean 'org.springframework.cloud.client.loadbalancer.reactive.LoadBalancerBeanPostProcessorAutoConfiguration$ReactorDeferringLoadBalancerFilterConfig' of type [org.springframework.cloud.client.loadbalancer.reactive.LoadBalancerBeanPostProcessorAutoConfiguration$ReactorDeferringLoadBalancerFilterConfig] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected/applied to a currently created BeanPostProcessor [loadBalancerWebClientBuilderBeanPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies/advisors. If this bean does not have to be post-processed, declare it with ROLE_INFRASTRUCTURE.
15:53:49.590 [main] WARN o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - [postProcessAfterInitialization,437] - Bean 'reactorDeferringLoadBalancerExchangeFilterFunction' of type [org.springframework.cloud.client.loadbalancer.reactive.DeferringLoadBalancerExchangeFilterFunction] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected/applied to a currently created BeanPostProcessor [loadBalancerWebClientBuilderBeanPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies/advisors. If this bean does not have to be post-processed, declare it with ROLE_INFRASTRUCTURE.
15:53:56.991 [main] INFO c.a.c.s.g.s.SentinelSCGAutoConfiguration - [sentinelGatewayFilter,143] - [Sentinel SpringCloudGateway] register SentinelGatewayFilter with order: -2147483648
15:53:57.784 [main] INFO c.a.c.s.g.s.SentinelSCGAutoConfiguration - [sentinelGatewayBlockExceptionHandler,133] - [Sentinel SpringCloudGateway] register SentinelGatewayBlockExceptionHandler
15:53:58.933 [main] WARN o.s.c.l.c.LoadBalancerCacheAutoConfiguration$LoadBalancerCaffeineWarnLogger - [afterPropertiesSet,94] - Spring Cloud LoadBalancer is currently working with the default cache. While this cache implementation is useful for development and tests, it's recommended to use Caffeine cache in production.You can switch to using Caffeine cache, by adding it and org.springframework.cache.caffeine.CaffeineCacheManager to the classpath.
15:54:02.492 [main] INFO c.r.g.RuoYiGatewayApplication - [logStarted,56] - Started RuoYiGatewayApplication in 29.907 seconds (process running for 32.506)
15:54:02.512 [main] INFO c.a.n.c.c.i.CacheData - [initNotifyWarnTimeout,72] - config listener notify warn timeout millis use default 60000 millis
15:54:02.513 [main] INFO c.a.n.c.c.i.CacheData - [,99] - nacos.cache.data.init.snapshot = true
15:54:02.516 [main] INFO c.a.n.c.c.i.ClientWorker - [addCacheDataIfAbsent,416] - [fixed-springboot3remote-172.18.18.91_8848] [subscribe] ruoyi-gateway+DEFAULT_GROUP+springboot3remote
15:54:02.556 [main] INFO c.a.n.c.c.i.CacheData - [addListener,236] - [fixed-springboot3remote-172.18.18.91_8848] [add-listener] ok, tenant=springboot3remote, dataId=ruoyi-gateway, group=DEFAULT_GROUP, cnt=1
15:54:02.557 [main] INFO c.a.c.n.r.NacosContextRefresher - [registerNacosListener,140] - [Nacos Config] Listening config: dataId=ruoyi-gateway, group=DEFAULT_GROUP
15:54:02.560 [main] INFO c.a.n.c.c.i.ClientWorker - [addCacheDataIfAbsent,416] - [fixed-springboot3remote-172.18.18.91_8848] [subscribe] ruoyi-gateway.yml+DEFAULT_GROUP+springboot3remote
15:54:02.560 [main] INFO c.a.n.c.c.i.CacheData - [addListener,236] - [fixed-springboot3remote-172.18.18.91_8848] [add-listener] ok, tenant=springboot3remote, dataId=ruoyi-gateway.yml, group=DEFAULT_GROUP, cnt=1
15:54:02.561 [main] INFO c.a.c.n.r.NacosContextRefresher - [registerNacosListener,140] - [Nacos Config] Listening config: dataId=ruoyi-gateway.yml, group=DEFAULT_GROUP
15:54:02.567 [main] INFO c.a.n.c.c.i.ClientWorker - [addCacheDataIfAbsent,416] - [fixed-springboot3remote-172.18.18.91_8848] [subscribe] ruoyi-gateway-prod.yml+DEFAULT_GROUP+springboot3remote
15:54:02.569 [main] INFO c.a.n.c.c.i.CacheData - [addListener,236] - [fixed-springboot3remote-172.18.18.91_8848] [add-listener] ok, tenant=springboot3remote, dataId=ruoyi-gateway-prod.yml, group=DEFAULT_GROUP, cnt=1
15:54:02.570 [main] INFO c.a.c.n.r.NacosContextRefresher - [registerNacosListener,140] - [Nacos Config] Listening config: dataId=ruoyi-gateway-prod.yml, group=DEFAULT_GROUP
(♥◠‿◠)ノ゙ 若依网关启动成功 ლ(´ڡ`ლ)゙

######## ###### ###### ### ######## ######## ## ## ### ##

## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##

## ## ## ## ## ## ## ## ## ## ## ## ##

## ## ## ####### ## #### ## ## ## ###### ## ## ## ## ##

## ## ## ## ## ######### ## ## ## ## ## #########

## ## ## ## ## ## ## ## ## ## ## ## ## ## ##

######## ###### ###### ## ## ## ######## ### ### ## ##

**

@pei-han
Copy link
Author

pei-han commented Dec 16, 2024

info-成功注册.log
info-启动但是不注册.log

使用cmd和eclipse启动服务,成功注册和未成功注册得日志。
同样得代码和配置(包括spring cloud alibaba discovery ,nacos server服务配置),启动服务,产生同得结果

@pei-han
Copy link
Author

pei-han commented Dec 16, 2024

@mercyblitz @lovepoem @fqtrnt please help me! Any suggest that i appreciate.

@pei-han
Copy link
Author

pei-han commented Dec 16, 2024

IDEA中可以正常启动服务,并注册到nacos server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant