-
Notifications
You must be signed in to change notification settings - Fork 544
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 Spring Cloud project throws exception when generating document. #404
Comments
Can you provide a complete, minimal, verifiable sample that reproduces the problem? |
code DocumentGenerator application will throw an exception when it starts, EchoTest does not. |
@spencergibb I am getting the same issue for Spring Boot 2.0.3, Spring cloud - Finchley Release, Consul agent 1.1.0 'Caused by: java.lang.IllegalArgumentException: Consul service ids must not be empty, must start with a letter, end with a letter or digit, and have as interior characters only letters, digits, and hyphen: 8092
at org.springframework.cloud.consul.serviceregistry.ConsulAutoRegistration.normalizeForDns(ConsulAutoRegistration.java:179) ~[spring-cloud-consul-discovery-2.0.0.RELEASE.jar:2.0.0.RELEASE]
at org.springframework.cloud.consul.serviceregistry.ConsulAutoRegistration.getInstanceId(ConsulAutoRegistration.java:170) ~[spring-cloud-consul-discovery-2.0.0.RELEASE.jar:2.0.0.RELEASE]
at org.springframework.cloud.consul.serviceregistry.ConsulAutoRegistration.registration(ConsulAutoRegistration.java:78) ~[spring-cloud-consul-discovery-2.0.0.RELEASE.jar:2.0.0.RELEASE]
at org.springframework.cloud.consul.serviceregistry.ConsulAutoServiceRegistrationAutoConfiguration.consulRegistration(ConsulAutoServiceRegistrationAutoConfiguration.java:69) ~[spring-cloud-consul-discovery-2.0.0.RELEASE.jar:2.0.0.RELEASE]
at org.springframework.cloud.consul.serviceregistry.ConsulAutoServiceRegistrationAutoConfiguration$$EnhancerBySpringCGLIB$$23c0b80f.CGLIB$consulRegistration$1(<generated>) ~[spring-cloud-consul-discovery-2.0.0.RELEASE.jar:2.0.0.RELEASE]
at org.springframework.cloud.consul.serviceregistry.ConsulAutoServiceRegistrationAutoConfiguration$$EnhancerBySpringCGLIB$$23c0b80f$$FastClassBySpringCGLIB$$bbf70181.invoke(<generated>) ~[spring-cloud-consul-discovery-2.0.0.RELEASE.jar:2.0.0.RELEASE]
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:361) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.cloud.consul.serviceregistry.ConsulAutoServiceRegistrationAutoConfiguration$$EnhancerBySpringCGLIB$$23c0b80f.consulRegistration(<generated>) ~[spring-cloud-consul-discovery-2.0.0.RELEASE.jar:2.0.0.RELEASE]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_92]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_92]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_92]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_92]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
... 71 common frames omitted Tried setting another property based on some camel consul issue reported here spring.application.instance_id=adminservice That didn't work either. This break service discovery at this point. |
Alright I take the last comment back. Adding "spring.application.instance_id" property makes it work but I had to pass it as a system environment property using -Dspring.application.instance_id=servicename Not sure why this needs to be done but its kind of a work around for now. |
@gamefundas, you need to make sure that you have the following configuration in a properly named file like
Only in that case, But if you do not specify |
That or disable consul discovery for tests that don't need it. |
it happens too. how fix it ? |
I get the same error with |
Sorry, My english is poor. |
I got the same error.
|
hi,
how to fix please, |
@rboughani this is very old. What versions are you using? |
Thank you spencergibb for you answer, |
The version of Spring Boot: 2.0.0.RELEASE
The version of Spring Cloud: Finchley M7
bootstrap.yaml:
Code:
Exception:
My another testcase can run without exception.
The text was updated successfully, but these errors were encountered: