jhipster无法在docker和本地电脑上运行。

问题描述 投票:0回答:1

我按照这里的所有步骤进行了操作。https:/www.jhipster.techinstallation

  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# 

是什么问题?

jhipster
1个回答
0
投票

解释在日志中。

错误创建名称为'cassandraConfiguration'的bean。Invocation of init method failed; nested exception is com.datastax.driver.core.exceptions.NoHostAvailableException: 所有尝试查询的主机都失败了(尝试:localhost127.0.0.1:9042)。

你可能忘了启动Cassandra,正如你的项目生成的README.md中所解释的那样。

docker-compose -f src/main/docker/cassandra.yml up -d
© www.soinside.com 2019 - 2024. All rights reserved.