簡體   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