2017-06-04 63 views
1

所以我建立了一個開箱即用的jHipster微服務網關。我有jHipster 4.5.2。除了回答設置問題之外,我沒有做任何事情(你可以在下面看到我的答案)。我分配它在localhost:8082上運行。我也安裝了可以工作的Tomcat 8.5.15;當我打開它時,我在localhost:8080上看到服務器頁面。無法啓動jHipster微服務網關開箱即用

我曾嘗試做運行網關如下:

/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 

回答

4

在此處顯示的錯誤:

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-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:我因爲您的網關已經使用嵌入式Undertow,所以不太瞭解您在這裏如何使用Tomcat,因此您不需要另一臺服務器。

+0

哦,好的。我不知道你也需要註冊表。我會盡快測試,並將其標記爲已回答,如果它有效。 – jimboweb

+0

所以我試圖測試你的解決方案,但由於角度依賴性問題,我無法獲得註冊表來編譯。這是一個不同的問題,但我無法確認答案,直到我得到它的工作。 – jimboweb

+0

好吧,現在就開始運行。謝謝! – jimboweb