Generator-jhipster: Monolith Application is checking Registry

Created on 16 Apr 2017  ยท  14Comments  ยท  Source: jhipster/generator-jhipster

Downloaded latest version JHipster 4.3 and while running getting error which based on previous issues seems like micro service issue when registry is not running.

Overview of the issue

2017-04-16 13:58:33.307 ERROR 19097 --- [ restartedMain] o.s.boot.SpringApplication : Application startup failed

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:130)
at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator$$FastClassBySpringCGLIB$$fa44b2a.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:721)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.retry.interceptor.RetryOperationsInterceptor$1.doWithRetry(RetryOperationsInterceptor.java:91)
at org.springframework.retry.support.RetryTemplate.doExecute(RetryTemplate.java:286)
at org.springframework.retry.support.RetryTemplate.execute(RetryTemplate.java:163)
at org.springframework.retry.interceptor.RetryOperationsInterceptor.invoke(RetryOperationsInterceptor.java:118)
at org.springframework.retry.annotation.AnnotationAwareRetryOperationsInterceptor.invoke(AnnotationAwareRetryOperationsInterceptor.java:152)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:656)
at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator$$EnhancerBySpringCGLIB$$6cd4db98.locate()
at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:89)
at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:611)
at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:348)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:312)
at com.dhub.dhub17.Dhub2App.main(Dhub2App.java:69)
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:497)
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/DHUB2/dev/master": Connection refused; nested exception is java.net.ConnectException: Connection refused
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:666)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:613)
at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:531)
at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.getRemoteEnvironment(ConfigServicePropertySourceLocator.java:170)
at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:91)
... 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.(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:78)
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:99)
at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator$BasicAuthorizationInterceptor.intercept(ConfigServicePropertySourceLocator.java:231)
at org.springframework.http.client.InterceptingClientHttpRequest$InterceptingRequestExecution.execute(InterceptingClientHttpRequest.java:86)
at org.springframework.http.client.InterceptingClientHttpRequest.executeInternal(InterceptingClientHttpRequest.java:70)
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:652)
... 26 common frames omitted

Reproduce the error
Related issues

Related issues are both for micro service, But i am getting this error when running Monolith

3778

3176

JHipster configuration
JHipster Version(s)
[email protected] /Users/capalytix/Documents/DHUB/DHUB2
โ”œโ”€โ”€ [email protected] 
โ””โ”€โ”ฌ [email protected]
  โ””โ”€โ”€ [email protected]  deduped

JHipster configuration, a .yo-rc.json file generated in the root folder
{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "com.dhub.dhub17",
      "nativeLanguage": "en"
    },
    "jhipsterVersion": "4.3.0",
    "baseName": "DHUB2",
    "packageName": "com.dhub.dhub17",
    "packageFolder": "com/dhub/dhub17",
    "serverPort": "8080",
    "authenticationType": "jwt",
    "hibernateCache": "hazelcast",
    "clusteredHttpSession": "hazelcast",
    "websocket": "spring-websocket",
    "databaseType": "sql",
    "devDatabaseType": "postgresql",
    "prodDatabaseType": "postgresql",
    "searchEngine": "elasticsearch",
    "messageBroker": "kafka",
    "serviceDiscoveryType": "eureka",
    "buildTool": "maven",
    "enableSocialSignIn": true,
    "jwtSecretKey": "d73980364b170c7bf0b2778ccf14ef92a8b119b7",
    "clientFramework": "angular1",
    "useSass": true,
    "clientPackageManager": "yarn",
    "applicationType": "monolith",
    "testFrameworks": [
      "protractor"
    ],
    "jhiPrefix": "jhi",
    "otherModules": [
      {
        "name": "generator-jhipster-swagger2markup",
        "version": "1.2.0"
      }
    ],
    "enableTranslation": true,
    "nativeLanguage": "en",
    "languages": [
      "en",
      "fr",
      "de"
    ]
  }
}
Entity configuration(s) entityName.json files generated in the .jhipster directory

ls: no such file or directory: .jhipster/*.json

Browsers and Operating System

java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)

git version 2.10.1 (Apple Git-78)

node: v6.10.2

npm: 4.5.0

bower: 1.8.0

gulp:
[14:10:44] CLI version 1.2.2
[14:10:44] Local version 3.9.1

yeoman: 1.8.5

yarn: 0.22.0

Browsers and Operating System

OSX El Capitan 10.11.6
Chrome 57.0.2987.133

Most helpful comment

Removed "serviceDiscoveryType": "eureka" and this fix the issue. Thanks @pascalgrimaud

All 14 comments

It seems that your registry is not correctly setup. How do you start the registry ?

Do I need start the registry in Monolith application? I am working on 3.9 version of Jhipster since long and never started any registry for that. Today i was just checking new functionality in 4.3 and unable to start with above mentioned error.

@shai2017 : yes you need the registry because you choose the option:
"serviceDiscoveryType": "eureka"

Removed "serviceDiscoveryType": "eureka" and this fix the issue. Thanks @pascalgrimaud

Hi @shai2017. I have the same error. I already removed the serviceDiscoveryType but the error continue. After you removed, you ran some command to upgrade the application? because seems my application don't get the news configuration.

@lazaropj : it's not enough to simply change your .yo-rc.json, you have to regenerate your application to apply the change

Hi @pascalgrimaud To regenerate the application I ran the command:

yo jhipster

But the application still calling the the eureka.

My log

Could not locate PropertySource: I/O error on GET request for "http://localhost:8761/config/pbn_backend/dev/master": Connection refused; nested exception is java.net.ConnectException: Connection refused

look my .yo-rc.json

{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "br.com.personal.pbn",
      "nativeLanguage": "pt-br"
    },
    "jhipsterVersion": "4.4.0",
    "baseName": "pbn_backend",
    "packageName": "br.com.personal.pbn",
    "packageFolder": "br/com/personal/pbn",
    "serverPort": "8080",
    "authenticationType": "jwt",
    "hibernateCache": "ehcache",
    "clusteredHttpSession": false,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "h2Disk",
    "prodDatabaseType": "postgresql",
    "searchEngine": false,
    "messageBroker": false,
    "buildTool": "maven",
    "enableSocialSignIn": true,
    "clientFramework": "angular1",
    "useSass": true,
    "clientPackageManager": "yarn",
    "applicationType": "monolith",
    "testFrameworks": [],
    "jhiPrefix": "jhi",
    "enableTranslation": true,
    "nativeLanguage": "pt-br",
    "languages": [
      "pt-br",
      "en",
      "es"
    ]
  }
}

@lazaropj : try to put "serviceDiscoveryType": false in your .yo-rc.json, and then, regenerate your app. Because, as this value is missing in your .yo-rc.json, the serviceDiscoveryType is eureka as default in v4.4.0

Hi @pascalgrimaud . Worked with "serviceDiscoveryType": false. Thank you

You need to re-generate it using "yo jhipster".

On 25 May 2017, at 19:30, Lazaro Jr notifications@github.com wrote:

Hi @shai2017. I have the same error. I already removed the serviceDiscoveryType but the error continue. After you removed, you ran some command to upgrade the application? because seems my application don't get the news configuration.

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

This issue seems to be back in JHipster 5.0.0.

Changing serviceDiscoveryType to false instead of eureka on new monolithic application do the job.
But with default installation server won't start. And I'm loosing one hour before trying your fully working fix ๐Ÿ‘

I post here just in case it will help people on this issue

Here is my original auto generated .yo-rc.json :

~jspn
{
"generator-jhipster": {
"promptValues": {
"packageName": "com.xxx.xxx",
"nativeLanguage": "fr"
},
"jhipsterVersion": "5.0.0",
"applicationType": "monolith",
"baseName": "XXX",
"packageName": "com.xxx.xxx",
"packageFolder": "com/xxx/xxx",
"serverPort": "8080",
"authenticationType": "jwt",
"cacheProvider": "ehcache",
"enableHibernateCache": true,
"websocket": false,
"databaseType": "sql",
"devDatabaseType": "h2Disk",
"prodDatabaseType": "mariadb",
"searchEngine": false,
"messageBroker": false,
"serviceDiscoveryType": false,
"buildTool": "maven",
"enableSwaggerCodegen": false,
"jwtSecretKey": "789bcadee5056cece23bd6776a8ec9112c1741f2",
"clientFramework": "angularX",
"useSass": true,
"clientPackageManager": "yarn",
"testFrameworks": [
"protractor"
],
"jhiPrefix": "jhi",
"enableTranslation": true,
"nativeLanguage": "fr",
"languages": [
"fr",
"en"
]
}
}
~

@jplongo did you generate your .yo-rc.json with the command line or with JHipster Online (I have some doubts about JHipster Online to be honnest!)

-> if that still fails could you please open a new ticket for this?

@jdubois Yes, I'm using CLI on MacOs High Sierra.
Installing JHipster 5.0.0 with Yeoman 2.0.2.

I did not open a ticket because working solution of this issue can be found here.
But I've previously start a projet with release 4.14.4 and did not have issue when building with ./mvnw.

If you think a new ticket is needed, I can create one.

Thanks

yo jhipster command will override your all development .So if you want to keep your codes
go change your "cloud" part of bootstrap.prod.yml like below :

`spring:

cloud:
    discovery:
        enabled: false
    config:
        fail-fast: false`
Was this page helpful?
0 / 5 - 0 ratings

Related issues

lsadehaan picture lsadehaan  ยท  3Comments

RizziCR picture RizziCR  ยท  3Comments

sdoxsee picture sdoxsee  ยท  4Comments

pascalgrimaud picture pascalgrimaud  ยท  4Comments

ahmedeldeeb25 picture ahmedeldeeb25  ยท  3Comments