Generator-jhipster: Default generated application fails to startup due failure to connect to Registry

Created on 27 Jun 2016  Â·  6Comments  Â·  Source: jhipster/generator-jhipster

Overview of the issue

The default generated application for microservices is not starting up. It seems that SpringBoot is not being able to connect to Registry.

java.lang.IllegalStateException: Could not locate PropertySource and the fail fast property is set, failing
        at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:110)
        at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator$$FastClassBySpringCGLIB$$fa44b2a.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
        at org.springframework.retry.interceptor.RetryOperationsInterceptor$1.doWithRetry(RetryOperationsInterceptor.java:74)
        at org.springframework.retry.support.RetryTemplate.doExecute(RetryTemplate.java:263)
        at org.springframework.retry.support.RetryTemplate.execute(RetryTemplate.java:154)
        at org.springframework.retry.interceptor.RetryOperationsInterceptor.invoke(RetryOperationsInterceptor.java:101)
        at org.springframework.retry.annotation.AnnotationAwareRetryOperationsInterceptor.invoke(AnnotationAwareRetryOperationsInterceptor.java:118)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655)
        at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator$$EnhancerBySpringCGLIB$$427ce7a0.locate(<generated>)
        at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:89)
        at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:640)
        at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:343)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
        at com.squaretrade.downloadmanager.DownloadmanagerApp.main(DownloadmanagerApp.java:66)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://localhost:8761/config/downloadmanager/dev/master": Connection refused; nested exception is java.net.ConnectException: Connection refused
        at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:607)
        at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:557)
        at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:475)
        at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.getRemoteEnvironment(ConfigServicePropertySourceLocator.java:130)
        at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:81)
        ... 22 common frames omitted
Caused by: java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.net.Socket.connect(Socket.java:589)
        at java.net.Socket.connect(Socket.java:538)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
        at sun.net.www.http.HttpClient.<init>(HttpClient.java:211)
        at sun.net.www.http.HttpClient.New(HttpClient.java:308)
        at sun.net.www.http.HttpClient.New(HttpClient.java:326)
        at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1169)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1105)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:999)
        at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:933)
        at org.springframework.http.client.SimpleBufferingClientHttpRequest.executeInternal(SimpleBufferingClientHttpRequest.java:80)
        at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:48)
        at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:53)
        at org.springframework.http.client.InterceptingClientHttpRequest$InterceptingRequestExecution.execute(InterceptingClientHttpRequest.java:93)
        at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator$BasicAuthorizationInterceptor.intercept(ConfigServicePropertySourceLocator.java:179)
        at org.springframework.http.client.InterceptingClientHttpRequest$InterceptingRequestExecution.execute(InterceptingClientHttpRequest.java:85)
        at org.springframework.http.client.InterceptingClientHttpRequest.executeInternal(InterceptingClientHttpRequest.java:69)
        at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:48)
        at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:53)
        at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:596)
        ... 26 common frames omitted
JHipster Version(s)

JHipster Generator v3.4.2

JHipster configuration, a .yo-rc.json file generated in the root folder

There was no such generated .yo-rc.json inside root folder at this point.
So, here are the selected steps for generate the initial application

Microservice application
baseName:downloadmanager
port:8081
JWT Authentication
SQL (Postgresl / H2)
HazelCast
ElasticSearch
Gradle
Internationalization (En)
Gatling

Reproduce the error
  • Pull the image
    docker pull jhipster/jhipster
  • Start the container
    docker run --name downloadmanager -v ~/jhipster:/Users/viniciusboson/dev/jhipster/downloadmanager -v ~/.m2:/home/jhipster/.m2 -p 8081:8081 -p 3000:3000 -p 3001:3001 -d -t jhipster/jhipster:latest
    PS: Both master and latest are having the same issue
  • Connect into the container
    docker exec -it downloadmanager bash
  • Generate the initial application
    yo jhipster
  • Select following options
    Microservice application
    baseName:downloadmanager
    port:8081
    JWT Authentication
    SQL (Postgresl / H2)
    HazelCast
    ElasticSearch
    Gradle
    Internationalization (En)
    Gatling
  • Start the application
    ./gradlew
    Related issues

The only related ticket that i've seen it #3176

Most helpful comment

The error states that your app can't connect to JHipster Registry, this project needs to be running at the same time for microservices and gatetway applications.

You can clone the repository jhipster/jhipster-registry and run it locally with ./mvnw. Another option is to run the Docker image, if you do this make sure to update the registry URL to point to Docker's IP. More documentation on the Registry can be found here: https://jhipster.github.io/microservices-architecture/#registry

All 6 comments

The error states that your app can't connect to JHipster Registry, this project needs to be running at the same time for microservices and gatetway applications.

You can clone the repository jhipster/jhipster-registry and run it locally with ./mvnw. Another option is to run the Docker image, if you do this make sure to update the registry URL to point to Docker's IP. More documentation on the Registry can be found here: https://jhipster.github.io/microservices-architecture/#registry

Thanks @ruddell -> closing this

I'm getting similar error when I try to deploy the default jhipster generated Monolithic application to could foundry using jhipster cloudfoundry sub generator.

@rlande please don't use an old closed issue. Create a new one with required details.

Unable to resolve the OpenID Configuration with the provided Issuer of "http://localhost:9080/auth/realms/jhipster" I am getting this error during startup

You have to start Keycloak first:

docker-compose -f src/main/docker/keycloak.yml up -d

On May 8, 2020, at 22:05, suryaaki notifications@github.com wrote:


Unable to resolve the OpenID Configuration with the provided Issuer of "http://localhost:9080/auth/realms/jhipster" I am getting this error during startup

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DanielFran picture DanielFran  Â·  3Comments

shivroy121 picture shivroy121  Â·  3Comments

edvjacek picture edvjacek  Â·  3Comments

Steven-Garcia picture Steven-Garcia  Â·  3Comments

pascalgrimaud picture pascalgrimaud  Â·  3Comments