jhipster не может работать на docker и локальном компьютере - PullRequest
0 голосов
/ 06 мая 2020

Я выполнил все шаги здесь: https://www.jhipster.tech/installation/

  1. для локальной конфигурации, jhipster был успешно собран, но не работал на порту 8080. Это ошибка:

2020-05-06 08:11:56.212 WARN 521 --- [ restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'servletEndpointRegistrar' defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration$WebMvcServletEndpointManagementContextConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.endpoint.web.ServletEndpointRegistrar]: Factory method 'servletEndpointRegistrar' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'healthEndpoint' defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.class]: Unsatisfied dependency expressed through method 'healthEndpoint' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'healthContributorRegistry' defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.health.HealthContributorRegistry]: Factory method 'healthContributorRegistry' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'JHipsterHealthIndicatorConfiguration' defined in file [/home/jhipster/app/target/classes/com/kschain/app/config/metrics/JHipsterHealthIndicatorConfiguration.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cassandraConfiguration': Invocation of init method failed; nested exception is com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: localhost/127.0.0.1:9042 (com.datastax.driver.core.exceptions.TransportException: [localhost/127.0.0.1:9042] Cannot connect)) 2020-05-06 08:11:58.253 ERROR 521 --- [ restartedMain] o.s.boot.SpringApplication : Application run failed

, и это то, что я получил после того, как все шаги выполнены

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  06:27 min
[INFO] Finished at: 2020-05-06T08:11:58Z
[INFO] ------------------------------------------------------------------------

2. Та же проблема возникла с изображением docker

 `2020-05-06 08:16:58.253 ERROR 521 --- [  restartedMain]
 o.s.boot.SpringApplication: Application run failed`

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  06:27 min
[INFO] Finished at: 2020-05-06T08:18:58Z
[INFO] ------------------------------------------------------------------------
root@e8220a295cf8:/home/jhipster/app# 

что не так?

1 Ответ

0 голосов
/ 07 мая 2020

Объяснение в журналах:

Ошибка создания bean-компонента с именем 'cassandraConfiguration': не удалось вызвать метод инициализации; вложенное исключение - com.datastax.driver.core.exceptions.NoHostAvailableException: все хосты, которые пытались выполнить запрос, завершились неудачно (попробовал: localhost / 127.0.0.1: 9042

Вероятно, вы забыли запустить Cassandra как объяснено в сгенерированном README.md вашего проекта :

docker-compose -f src/main/docker/cassandra.yml up -d
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...