generator-jhipster: Windows + Elasticsearch error when re-running jhipster project: Error creating bean with name 'userService' defined in file ...

Overview of the issue

Elasticsearch error when re-running jhipster project: Error creating bean with name ‘userService’ defined in file … First time it runs without error. But when I re-run the project I get an error. When I delete nodes in target/elasticsearch/data/nodes folder it runs succesfully but when I try to re-run again it fails with same error.

2019-10-29 09:49:36.950  INFO 5616 --- [  restartedMain] com.nokat.gazna.GaznaApp                 : Starting GaznaApp on HP with PID 5616 (D:\Projects\JHipster\Gazna\backend\target\classes started by Nury in D:\Projects\JHipster\Gazna\backend)
2019-10-29 09:49:36.954 DEBUG 5616 --- [  restartedMain] com.nokat.gazna.GaznaApp                 : Running with Spring Boot v2.1.9.RELEASE, Spring v5.1.10.RELEASE
2019-10-29 09:49:36.954  INFO 5616 --- [  restartedMain] com.nokat.gazna.GaznaApp                 : The following profiles are active: swagger,dev
2019-10-29 09:49:44.415 DEBUG 5616 --- [  restartedMain] c.ehcache.core.Ehcache-usersByLogin      : Initialize successful.
2019-10-29 09:49:44.431 DEBUG 5616 --- [  restartedMain] c.ehcache.core.Ehcache-usersByEmail      : Initialize successful.
2019-10-29 09:49:44.431 DEBUG 5616 --- [  restartedMain] c.e.c.E.nokat.gazna.domain.User          : Initialize successful.
2019-10-29 09:49:44.446 DEBUG 5616 --- [  restartedMain] c.e.c.E.nokat.gazna.domain.Authority     : Initialize successful.
2019-10-29 09:49:44.446 DEBUG 5616 --- [  restartedMain] c.e.c.E.n.gazna.domain.User.authorities  : Initialize successful.
2019-10-29 09:49:44.446 DEBUG 5616 --- [  restartedMain] c.e.c.E.nokat.gazna.domain.Region        : Initialize successful.
2019-10-29 09:49:44.446 DEBUG 5616 --- [  restartedMain] c.e.c.E.nokat.gazna.domain.Country       : Initialize successful.
2019-10-29 09:49:44.446 DEBUG 5616 --- [  restartedMain] c.e.c.E.nokat.gazna.domain.Location      : Initialize successful.
2019-10-29 09:49:44.446 DEBUG 5616 --- [  restartedMain] c.e.c.E.nokat.gazna.domain.Department    : Initialize successful.
2019-10-29 09:49:44.462 DEBUG 5616 --- [  restartedMain] c.e.c.E.n.g.domain.Department.employees  : Initialize successful.
2019-10-29 09:49:44.464 DEBUG 5616 --- [  restartedMain] c.e.c.E.nokat.gazna.domain.Task          : Initialize successful.
2019-10-29 09:49:44.466 DEBUG 5616 --- [  restartedMain] c.e.c.E.nokat.gazna.domain.Task.jobs     : Initialize successful.
2019-10-29 09:49:44.469 DEBUG 5616 --- [  restartedMain] c.e.c.E.nokat.gazna.domain.Employee      : Initialize successful.
2019-10-29 09:49:44.471 DEBUG 5616 --- [  restartedMain] c.e.c.E.n.gazna.domain.Employee.jobs     : Initialize successful.
2019-10-29 09:49:44.473 DEBUG 5616 --- [  restartedMain] c.e.c.E.nokat.gazna.domain.Job           : Initialize successful.
2019-10-29 09:49:44.476 DEBUG 5616 --- [  restartedMain] c.e.c.E.nokat.gazna.domain.Job.tasks     : Initialize successful.
2019-10-29 09:49:44.478 DEBUG 5616 --- [  restartedMain] c.e.c.E.nokat.gazna.domain.JobHistory    : Initialize successful.
2019-10-29 09:49:44.482 DEBUG 5616 --- [  restartedMain] c.nokat.gazna.config.AsyncConfiguration  : Creating Async Task Executor
2019-10-29 09:49:44.581 DEBUG 5616 --- [  restartedMain] c.n.gazna.config.LiquibaseConfiguration  : Configuring Liquibase
2019-10-29 09:49:44.781  WARN 5616 --- [   gazna-task-1] i.g.j.c.liquibase.AsyncSpringLiquibase   : Starting Liquibase asynchronously, your database might not be ready at startup!
2019-10-29 09:49:48.677 DEBUG 5616 --- [   gazna-task-1] i.g.j.c.liquibase.AsyncSpringLiquibase   : Liquibase has updated your database in 3896 ms
2019-10-29 09:49:48.807 DEBUG 5616 --- [  restartedMain] com.nokat.gazna.config.WebConfigurer     : Registering CORS filter
2019-10-29 09:49:48.874  INFO 5616 --- [  restartedMain] com.nokat.gazna.config.WebConfigurer     : Web application configuration, using profiles: swagger
2019-10-29 09:49:48.875  INFO 5616 --- [  restartedMain] com.nokat.gazna.config.WebConfigurer     : Web application fully configured
2019-10-29 09:49:49.112 DEBUG 5616 --- [  restartedMain] c.n.gazna.security.jwt.TokenProvider     : Using a Base64-encoded JWT secret key
2019-10-29 09:49:49.519  INFO 5616 --- [  restartedMain] a.d.j.ElasticsearchJestAutoConfiguration : Create test ES node
2019-10-29 09:49:50.196  WARN 5616 --- [  restartedMain] o.e.deprecation.script.ScriptModule      : Script: returning default values for missing document values is deprecated. Set system property '-Des.scripting.exception_for_missing_value=true' to make behaviour compatible with future major versions.
2019-10-29 09:49:52.238 DEBUG 5616 --- [  restartedMain] i.n.channel.MultithreadEventLoopGroup    : -Dio.netty.eventLoopThreads: 16
2019-10-29 09:49:52.252 DEBUG 5616 --- [  restartedMain] io.netty.channel.nio.NioEventLoop        : -Dio.netty.noKeySetOptimization: false
2019-10-29 09:49:52.253 DEBUG 5616 --- [  restartedMain] io.netty.channel.nio.NioEventLoop        : -Dio.netty.selectorAutoRebuildThreshold: 512
2019-10-29 09:49:52.397 DEBUG 5616 --- [  restartedMain] io.netty.channel.DefaultChannelId        : -Dio.netty.processId: 5616 (auto-detected)
2019-10-29 09:49:52.546 DEBUG 5616 --- [  restartedMain] io.netty.channel.DefaultChannelId        : -Dio.netty.machineId: 14:cc:20:ff:fe:17:c1:25 (auto-detected)
2019-10-29 09:49:52.562 DEBUG 5616 --- [  restartedMain] io.netty.buffer.PooledByteBufAllocator   : -Dio.netty.allocator.numHeapArenas: 16
2019-10-29 09:49:52.562 DEBUG 5616 --- [  restartedMain] io.netty.buffer.PooledByteBufAllocator   : -Dio.netty.allocator.numDirectArenas: 16
2019-10-29 09:49:52.562 DEBUG 5616 --- [  restartedMain] io.netty.buffer.PooledByteBufAllocator   : -Dio.netty.allocator.pageSize: 8192
2019-10-29 09:49:52.562 DEBUG 5616 --- [  restartedMain] io.netty.buffer.PooledByteBufAllocator   : -Dio.netty.allocator.maxOrder: 11
2019-10-29 09:49:52.562 DEBUG 5616 --- [  restartedMain] io.netty.buffer.PooledByteBufAllocator   : -Dio.netty.allocator.chunkSize: 16777216
2019-10-29 09:49:52.562 DEBUG 5616 --- [  restartedMain] io.netty.buffer.PooledByteBufAllocator   : -Dio.netty.allocator.tinyCacheSize: 512
2019-10-29 09:49:52.562 DEBUG 5616 --- [  restartedMain] io.netty.buffer.PooledByteBufAllocator   : -Dio.netty.allocator.smallCacheSize: 256
2019-10-29 09:49:52.562 DEBUG 5616 --- [  restartedMain] io.netty.buffer.PooledByteBufAllocator   : -Dio.netty.allocator.normalCacheSize: 64
2019-10-29 09:49:52.562 DEBUG 5616 --- [  restartedMain] io.netty.buffer.PooledByteBufAllocator   : -Dio.netty.allocator.maxCachedBufferCapacity: 32768
2019-10-29 09:49:52.562 DEBUG 5616 --- [  restartedMain] io.netty.buffer.PooledByteBufAllocator   : -Dio.netty.allocator.cacheTrimInterval: 8192
2019-10-29 09:49:52.562 DEBUG 5616 --- [  restartedMain] io.netty.buffer.PooledByteBufAllocator   : -Dio.netty.allocator.cacheTrimIntervalMillis: 0
2019-10-29 09:49:52.562 DEBUG 5616 --- [  restartedMain] io.netty.buffer.PooledByteBufAllocator   : -Dio.netty.allocator.useCacheForAllThreads: true
2019-10-29 09:49:52.562 DEBUG 5616 --- [  restartedMain] io.netty.buffer.PooledByteBufAllocator   : -Dio.netty.allocator.maxCachedByteBuffersPerChunk: 1023
2019-10-29 09:49:52.562 DEBUG 5616 --- [  restartedMain] io.netty.buffer.ByteBufUtil              : -Dio.netty.allocator.type: pooled
2019-10-29 09:49:52.562 DEBUG 5616 --- [  restartedMain] io.netty.buffer.ByteBufUtil              : -Dio.netty.threadLocalDirectBufferSize: 0
2019-10-29 09:49:52.562 DEBUG 5616 --- [  restartedMain] io.netty.buffer.ByteBufUtil              : -Dio.netty.maxThreadLocalCharBufferSize: 16384
2019-10-29 09:49:59.341 DEBUG 5616 --- [er_worker][T#3]] io.netty.buffer.AbstractByteBuf          : -Dio.netty.buffer.checkAccessible: true
2019-10-29 09:49:59.341 DEBUG 5616 --- [er_worker][T#3]] io.netty.buffer.AbstractByteBuf          : -Dio.netty.buffer.checkBounds: true
2019-10-29 09:50:04.493  WARN 5616 --- [  restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userService' defined in file [D:\Projects\JHipster\Gazna\backend\target\classes\com\nokat\gazna\service\UserService.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userSearchRepository': Invocation of init method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.elasticsearch.repository.support.NumberKeyedRepository]: Constructor threw exception; nested exception is org.springframework.data.elasticsearch.ElasticsearchException: Failed to build mapping for user:user
2019-10-29 09:50:04.493  INFO 5616 --- [  restartedMain] a.d.j.ElasticsearchJestAutoConfiguration : Closing Elasticsearch client
2019-10-29 09:50:04.493 DEBUG 5616 --- [er_worker][T#3]] io.netty.buffer.PoolThreadCache          : Freed 1 thread-local buffer(s) from thread: elasticsearch[wejQHpG][http_server_worker][T#3]
2019-10-29 09:50:05.163 DEBUG 5616 --- [  restartedMain] c.e.c.E.n.gazna.domain.User.authorities  : Close successful.
2019-10-29 09:50:05.163 DEBUG 5616 --- [  restartedMain] c.e.c.E.nokat.gazna.domain.Country       : Close successful.
2019-10-29 09:50:05.163 DEBUG 5616 --- [  restartedMain] c.e.c.E.nokat.gazna.domain.Location      : Close successful.
2019-10-29 09:50:05.163 DEBUG 5616 --- [  restartedMain] c.e.c.E.nokat.gazna.domain.Department    : Close successful.
2019-10-29 09:50:05.163 DEBUG 5616 --- [  restartedMain] c.e.c.E.n.g.domain.Department.employees  : Close successful.
2019-10-29 09:50:05.163 DEBUG 5616 --- [  restartedMain] c.e.c.E.nokat.gazna.domain.Region        : Close successful.
2019-10-29 09:50:05.163 DEBUG 5616 --- [  restartedMain] c.e.c.E.nokat.gazna.domain.Task          : Close successful.
2019-10-29 09:50:05.163 DEBUG 5616 --- [  restartedMain] c.e.c.E.nokat.gazna.domain.Authority     : Close successful.
2019-10-29 09:50:05.163 DEBUG 5616 --- [  restartedMain] c.e.c.E.nokat.gazna.domain.Task.jobs     : Close successful.
2019-10-29 09:50:05.163 DEBUG 5616 --- [  restartedMain] c.e.c.E.nokat.gazna.domain.JobHistory    : Close successful.
2019-10-29 09:50:05.163 DEBUG 5616 --- [  restartedMain] c.e.c.E.nokat.gazna.domain.Job.tasks     : Close successful.
2019-10-29 09:50:05.163 DEBUG 5616 --- [  restartedMain] c.e.c.E.nokat.gazna.domain.User          : Close successful.
2019-10-29 09:50:05.163 DEBUG 5616 --- [  restartedMain] c.e.c.E.nokat.gazna.domain.Job           : Close successful.
2019-10-29 09:50:05.163 DEBUG 5616 --- [  restartedMain] c.e.c.E.n.gazna.domain.Employee.jobs     : Close successful.
2019-10-29 09:50:05.163 DEBUG 5616 --- [  restartedMain] c.e.c.E.nokat.gazna.domain.Employee      : Close successful.
2019-10-29 09:50:05.163 DEBUG 5616 --- [  restartedMain] c.ehcache.core.Ehcache-usersByEmail      : Close successful.
2019-10-29 09:50:05.163 DEBUG 5616 --- [  restartedMain] c.ehcache.core.Ehcache-usersByLogin      : Close successful.
2019-10-29 09:50:05.233 ERROR 5616 --- [  restartedMain] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userService' defined in file [D:\Projects\JHipster\Gazna\backend\target\classes\com\nokat\gazna\service\UserService.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userSearchRepository': Invocation of init method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.elasticsearch.repository.support.NumberKeyedRepository]: Constructor threw exception; nested exception is org.springframework.data.elasticsearch.ElasticsearchException: Failed to build mapping for user:user
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:769)
	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:218)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1341)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1187)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:847)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:312)
	at com.nokat.gazna.GaznaApp.main(GaznaApp.java:63)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userSearchRepository': Invocation of init method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.elasticsearch.repository.support.NumberKeyedRepository]: Constructor threw exception; nested exception is org.springframework.data.elasticsearch.ElasticsearchException: Failed to build mapping for user:user
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1778)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:277)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1255)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1175)
	at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:857)
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:760)
	... 22 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.elasticsearch.repository.support.NumberKeyedRepository]: Constructor threw exception; nested exception is org.springframework.data.elasticsearch.ElasticsearchException: Failed to build mapping for user:user
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:184)
	at org.springframework.data.repository.core.support.RepositoryFactorySupport.lambda$getTargetRepositoryViaReflection$3(RepositoryFactorySupport.java:513)
	at java.base/java.util.Optional.map(Optional.java:265)
	at org.springframework.data.repository.core.support.RepositoryFactorySupport.getTargetRepositoryViaReflection(RepositoryFactorySupport.java:513)
	at org.springframework.data.repository.core.support.RepositoryFactorySupport.getTargetRepositoryViaReflection(RepositoryFactorySupport.java:498)
	at org.springframework.data.elasticsearch.repository.support.ElasticsearchRepositoryFactory.getTargetRepository(ElasticsearchRepositoryFactory.java:74)
	at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:305)
	at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.lambda$afterPropertiesSet$5(RepositoryFactoryBeanSupport.java:297)
	at org.springframework.data.util.Lazy.getNullable(Lazy.java:211)
	at org.springframework.data.util.Lazy.get(Lazy.java:94)
	at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:300)
	at org.springframework.data.elasticsearch.repository.support.ElasticsearchRepositoryFactoryBean.afterPropertiesSet(ElasticsearchRepositoryFactoryBean.java:67)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1837)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1774)
	... 33 common frames omitted
Caused by: org.springframework.data.elasticsearch.ElasticsearchException: Failed to build mapping for user:user
	at com.github.vanroy.springdata.jest.JestElasticsearchTemplate.putMapping(JestElasticsearchTemplate.java:265)
	at com.github.vanroy.springdata.jest.JestElasticsearchTemplate.putMapping(JestElasticsearchTemplate.java:277)
	at com.github.vanroy.springdata.jest.JestElasticsearchTemplate.putMapping(JestElasticsearchTemplate.java:237)
	at org.springframework.data.elasticsearch.repository.support.AbstractElasticsearchRepository.putMapping(AbstractElasticsearchRepository.java:100)
	at org.springframework.data.elasticsearch.repository.support.AbstractElasticsearchRepository.<init>(AbstractElasticsearchRepository.java:88)
	at org.springframework.data.elasticsearch.repository.support.NumberKeyedRepository.<init>(NumberKeyedRepository.java:36)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:172)
	... 46 common frames omitted
Caused by: org.springframework.data.elasticsearch.ElasticsearchException: failed to execute action
	at com.github.vanroy.springdata.jest.JestElasticsearchTemplate.execute(JestElasticsearchTemplate.java:1131)
	at com.github.vanroy.springdata.jest.JestElasticsearchTemplate.executeWithAcknowledge(JestElasticsearchTemplate.java:1136)
	at com.github.vanroy.springdata.jest.JestElasticsearchTemplate.putMapping(JestElasticsearchTemplate.java:262)
	... 56 common frames omitted
Caused by: java.net.SocketTimeoutException: Read timed out
	at java.base/java.net.SocketInputStream.socketRead0(Native Method)
	at java.base/java.net.SocketInputStream.socketRead(SocketInputStream.java:115)
	at java.base/java.net.SocketInputStream.read(SocketInputStream.java:168)
	at java.base/java.net.SocketInputStream.read(SocketInputStream.java:140)
	at org.apache.http.impl.io.SessionInputBufferImpl.streamRead(SessionInputBufferImpl.java:137)
	at org.apache.http.impl.io.SessionInputBufferImpl.fillBuffer(SessionInputBufferImpl.java:153)
	at org.apache.http.impl.io.SessionInputBufferImpl.readLine(SessionInputBufferImpl.java:280)
	at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:138)
	at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:56)
	at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259)
	at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:163)
	at org.apache.http.impl.conn.CPoolProxy.receiveResponseHeader(CPoolProxy.java:157)
	at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273)
	at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
	at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:272)
	at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
	at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
	at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
	at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
	at io.searchbox.client.http.JestHttpClient.executeRequest(JestHttpClient.java:136)
	at io.searchbox.client.http.JestHttpClient.execute(JestHttpClient.java:70)
	at io.searchbox.client.http.JestHttpClient.execute(JestHttpClient.java:63)
	at com.github.vanroy.springdata.jest.JestElasticsearchTemplate.execute(JestElasticsearchTemplate.java:1123)
	... 58 common frames omitted


Process finished with exit code 1

Motivation for or Use Case

After generating jhipster with elasticsearch I imported jdl file and I didn’t do any code changes.

Reproduce the error
  1. Generate jhipster with elasticsearch
  2. Import jdl file
  3. Run (No problem at first run)
  4. Stop and Run again
  5. Process finished with exit code 1

Note: I am using IntelliJ IDEA

Please find the GitHub repository to reproduce the error. https://github.com/nury-garryyev/jhipster

Related issues

#10199 #3958

Suggest a Fix

I think that the problem with elasticserach. It wants to reproduce the same nodes/indices. When I delete nodes in target/elasticsearch/data/nodes folder it runs succesfully but when I try to re-run again it fails with the same error.

JHipster Version(s)
gazna@0.0.0 D:\Projects\JHipster\Gazna\backend
`-- generator-jhipster@6.4.1

JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "com.nokat.gazna",
      "nativeLanguage": "en"
    },
    "jhipsterVersion": "6.4.1",
    "applicationType": "monolith",
    "baseName": "gazna",
    "packageName": "com.nokat.gazna",
    "packageFolder": "com/nokat/gazna",
    "serverPort": "8080",
    "authenticationType": "jwt",
    "cacheProvider": "ehcache",
    "enableHibernateCache": true,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "postgresql",
    "prodDatabaseType": "postgresql",
    "searchEngine": "elasticsearch",
    "messageBroker": false,
    "serviceDiscoveryType": false,
    "buildTool": "maven",
    "enableSwaggerCodegen": false,
    "jwtSecretKey": "",
    "embeddableLaunchScript": false,
    "testFrameworks": [],
    "jhiPrefix": "jhi",
    "entitySuffix": "",
    "dtoSuffix": "DTO",
    "otherModules": [],
    "enableTranslation": true,
    "clientPackageManager": "npm",
    "nativeLanguage": "en",
    "languages": [
      "en",
      "ru",
      "tr"
    ],
    "blueprints": [],
    "skipClient": true
  }
}
JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions
entity Region {
  regionName String
}
entity Country {
  countryName String
}
/**
 * not an ignored comment
 */
entity Location {
  streetAddress String,
  postalCode String,
  city String,
  stateProvince String
}
entity Department {
  departmentName String required
}
/**
 * Task entity.\n@author The JHipster team.
 */
entity Task {
  title String,
  description String
}
/**
 * The Employee entity.
 */
entity Employee {
  /**
   * The firstname attribute.
   */
  firstName String,
  lastName String,
  email String,
  phoneNumber String,
  hireDate Instant,
  salary Long,
  commissionPct Long
}
entity Job {
  jobTitle String,
  minSalary Long,
  maxSalary Long
}
entity JobHistory {
  startDate Instant,
  endDate Instant,
  language Language
}
enum Language {
  FRENCH,
  ENGLISH,
  SPANISH
}

relationship OneToOne {
  Country{region} to Region,
  Location{country} to Country,
  Department{location} to Location,
  JobHistory{job} to Job,
  JobHistory{department} to Department,
  JobHistory{employee} to Employee
}
relationship OneToMany {
  /**
   * A relationship
   */
  Department{employee} to Employee{department},
  Employee{job} to Job{employee}
}
relationship ManyToOne {
  Employee{manager} to Employee
}
relationship ManyToMany {
  Job{task(title)} to Task{job}
}

service Region, Country, Location, Department, Task, JobHistory with serviceImpl
paginate Employee, JobHistory with infinite-scroll
paginate Job with pagination

Environment and Tools

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

git version 2.10.2.windows.1

node: v10.16.3

npm: 6.9.0

yeoman: 3.1.0

Browsers and Operating System

Windows 8, Chrome

  • Checking this box is mandatory (this is just to show you read everything)

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 17 (5 by maintainers)

Most upvoted comments

Thanks for your feedback. So the problem is related to Windows.

What I can suggest is :

  • edit your application-dev.yml to use the same Elasticsearch config in application-prod.yml
  • start your own Elasticsearch or use the provided docker-compose file
  • start your app in dev

The goal is to use a real Elasticsearch in dev, instead of an embedded one, as it looks like you got some problem with target / nodes folder

Here is my workaroud: Add

spring.data.jest.read-timeout

with longer value. Default is 5000ms in com.github.vanroy.springboot.autoconfigure.data.jest.ElasticsearchJestProperties.class.

spring:
  data:
    elasticsearch:
      properties:
        path:
          home: target/elasticsearch
    jest:
      read-timeout: 15000