简体   繁体   English

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

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

So I've built a jHipster microservices gateway out of the box. 因此,我已经开箱即用地构建了一个jHipster微服务网关。 I have jHipster 4.5.2. 我有jHipster 4.5.2。 I have done nothing to it beyond answering the setup questions (you can see my answers below). 除了回答设置问题外,我什么也没做(您可以在下面看到我的答案)。 I assigned it to run on localhost:8082. 我将其分配为在localhost:8082上运行。 I also have installed Tomcat 8.5.15, which works; 我还安装了Tomcat 8.5.15,它可以工作; when I turn it on I see the server page at localhost:8080. 当我打开它时,我在localhost:8080看到服务器页面。

I have tried to run the gateway by doing the following: 我试图通过执行以下操作来运行网关:

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

When it tries to start up I get the following warning early on: 当它尝试启动时,我会在早期收到以下警告:

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

But the Tomcat server is running: when I go to localhost:8080 the page is there. 但是Tomcat服务器正在运行:当我转到localhost:8080时,页面就在那里了。

There is a ton of boilerplate, hundreds of lines, so I won't copy them all. 一吨样板,几百行,所以我不会全部复制。 But in the following errors keep repeating 但是以下错误不断重复

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

Eventually it just shuts down without starting. 最终,它只是关闭而没有启动。

I've also tried to start it by running it from NetBeans. 我还尝试通过从NetBeans运行它来启动它。 When I have Tomcat turned on, it quits because "Failed to start Tomcat: port 8080 is already in use." 当我打开Tomcat时,它退出,因为“无法启动Tomcat:端口8080已在使用中。” So, fine, start it with Tomcat turned off so it can turn it on itself. 因此,可以在关闭Tomcat的情况下启动它,以便可以自行打开它。 Then it won't start because "connection refused." 然后它就不会启动,因为“连接被拒绝”。

How can I get my app to start? 如何启动我的应用程序?

I answered the setup questions the following way: 我通过以下方式回答了设置问题:

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

The error is indicated here: 错误显示在这里:

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

It means you didn't start the JHipster Registry. 这意味着您没有启动JHipster注册表。 For that, you have 2 solutions: 为此,您有2个解决方案:

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

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

Then, try to log into the JHipster Registry at http://localhost:8761 然后,尝试登录http:// localhost:8761登录到JHipster注册表。

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

PS: I don't understand very well how you use Tomcat here, as your Gateway already uses embedded Undertow, so you don't need another server. PS:我不太了解您如何在此处使用Tomcat,因为您的网关已经使用了嵌入式Undertow,因此您不需要其他服务器。

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

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