繁体   English   中英

无法立即启动jHipster微服务网关

[英]Can't start jHipster microservice gateway out of box

因此,我已经开箱即用地构建了一个jHipster微服务网关。 我有jHipster 4.5.2。 除了回答设置问题外,我什么也没做(您可以在下面看到我的答案)。 我将其分配为在localhost:8082上运行。 我还安装了Tomcat 8.5.15,它可以工作; 当我打开它时,我在localhost:8080看到服务器页面。

我试图通过执行以下操作来运行网关:

/Users/jimstewart/apache-maven-3.3.9/bin/mvn -Pprod package
java -jar target/data-gateway-0.0.1-SNAPSHOT.war

当它尝试启动时,我会在早期收到以下警告:

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

但是Tomcat服务器正在运行:当我转到localhost:8080时,页面就在那里了。

一吨样板,几百行,所以我不会全部复制。 但是以下错误不断重复

2017-06-03 22:48:58.671 ERROR 1271 --- [           main] c.n.d.s.t.d.RedirectingEurekaHttpClient  : Request execution error

2017-06-03 22:48:58.674  WARN 1271 --- [           main] 
c.n.d.s.t.d.RetryableEurekaHttpClient    : Request execution failed with 
message: java.net.ConnectException: Connection refused

2017-06-03 22:48:58.675 ERROR 1271 --- [           main] 
com.netflix.discovery.DiscoveryClient    : 
DiscoveryClient_DATAGATEWAY/DataGateway:5ee0c99cb98fec0674d7db2672260892 - was 
unable to refresh its cache! status = Cannot execute request on any known server

2017-06-03 22:49:17.689  WARN 1271 --- [nfoReplicator-0] 
c.n.d.s.t.d.RetryableEurekaHttpClient    : Request execution failed with message: java.net.ConnectException: Connection refused

最终,它只是关闭而没有启动。

我还尝试通过从NetBeans运行它来启动它。 当我打开Tomcat时,它退出,因为“无法启动Tomcat:端口8080已在使用中。” 因此,可以在关闭Tomcat的情况下启动它,以便可以自行打开它。 然后它就不会启动,因为“连接被拒绝”。

如何启动我的应用程序?

我通过以下方式回答了设置问题:

What kind of application? Gateway application
What is the base name? DataGateway
Would you like to install other generators? No
Which port do you want to run it on? 8082
What is your default package name? com.kidslearntocode.datagateway
Do you want to use the jHipster registry? Yes
What kind of authentication? JWT
What type of database? SQL
What production database? mySQL
What development database? mySQL
Maven or Gradle? Maven
Which other technologies? None
Which framework? [beta] Angular 4
LibSass? Yes
Internationalization? No
Other languages? None

错误显示在这里:

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

这意味着您没有启动JHipster注册表。 为此,您有2个解决方案:

1)使用Docker,只需启动: docker-compose -f src/main/docker/jhipster-registry.yml up -d

2)克隆项目https://github.com/jhipster/jhipster-registry ,然后yarn install并启动注册表: ./mvwn

然后,尝试登录http:// localhost:8761登录到JHipster注册表。

更多信息请参见https://jhipster.github.io/api-gateway/

PS:我不太了解您如何在此处使用Tomcat,因为您的网关已经使用了嵌入式Undertow,因此您不需要其他服务器。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM