gpt4 book ai didi

tomcat - 无法开箱即用地启动 jHipster 微服务网关

转载 作者:行者123 更新时间:2023-11-28 22:06:07 25 4
gpt4 key购买 nike

所以我构建了一个开箱即用的 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

最佳答案

此处指出错误:

无法找到 PropertySource:“http://localhost:8761/config/DataGateway/dev/master”的 GET 请求上的 I/O 错误:连接被拒绝;嵌套异常是 java.net.ConnectExc

这意味着你没有启动 JHipster Registry。为此,您有 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 Registry。

更多信息请访问 https://jhipster.github.io/api-gateway/

PS:我不太明白你这里是怎么用Tomcat的,因为你的Gateway已经使用了内嵌的Undertow,所以你不需要另外的服务器。

关于tomcat - 无法开箱即用地启动 jHipster 微服务网关,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44350408/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com