2

我是 Jhipster 的新手。我试图运行 mvnw 但请求执行错误 Connection denied: connect is occurred。

2017-07-14 10:36:17.411  INFO 19864 --- [  restartedMain] com.netflix.discovery.DiscoveryClient    : Saw local status change event StatusChangeEvent [timestamp=1500008777411, current=UP, previous=STARTING]
2017-07-14 10:36:17.946  INFO 19864 --- [  restartedMain] com.lxisoft.diviso.DivisoApp             : Started DivisoApp in 27.953 seconds (JVM running for 29.457)
2017-07-14 10:36:17.961  INFO 19864 --- [  restartedMain] com.lxisoft.diviso.DivisoApp             :
----------------------------------------------------------
        Application 'diviso' is running! Access URLs:
        Local:          http://localhost:8080
        External:       http://192.168.43.43:8080
        Profile(s):     [swagger, dev]
----------------------------------------------------------
2017-07-14 10:36:17.978  INFO 19864 --- [  restartedMain] com.lxisoft.diviso.DivisoApp             :
----------------------------------------------------------
        Config Server:  Not found or not setup for this application
----------------------------------------------------------
2017-07-14 10:36:18.463  WARN 19864 --- [nfoReplicator-0] c.c.c.ConfigServicePropertySourceLocator : Could not locate PropertySource: I/O error on GET request for "http://localhost:8761/config/diviso/dev/master": Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: connect
2017-07-14 10:36:18.467  INFO 19864 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_DIVISO/diviso:44489811627d5f65d0e44a2af1489c68: registering service...
2017-07-14 10:36:20.480 ERROR 19864 --- [nfoReplicator-0] c.n.d.s.t.d.RedirectingEurekaHttpClient  : Request execution error

com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused: connect
        at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:187)
        at com.sun.jersey.api.client.filter.GZIPContentEncodingFilter.handle(GZIPContentEncodingFilter.java:123)
        at com.netflix.discovery.EurekaIdentityHeaderFilter.handle(EurekaIdentityHeaderFilter.java:27)
        at com.sun.jersey.api.client.Client.handle(Client.java:652)
        at com.sun.jersey.api.client.WebResource.handle(WebResource.java:682)
        at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
        at com.sun.jersey.api.client.WebResource$Builder.post(WebResource.java:570)
        at com.netflix.discovery.shared.transport.jersey.AbstractJerseyEurekaHttpClient.register(AbstractJerseyEurekaHttpClient.java:56)
        at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$1.execute(EurekaHttpClientDecorator.java:59)
        at com.netflix.discovery.shared.transport.decorator.MetricsCollectingEurekaHttpClient.execute(MetricsCollectingEurekaHttpClient.java:73)
        at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.register(EurekaHttpClientDecorator.java:56)
        at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$1.execute(EurekaHttpClientDecorator.java:59)
        at com.netflix.discovery.shared.transport.decorator.RedirectingEurekaHttpClient.executeOnNewServer(RedirectingEurekaHttpClient.java:118)
        at com.netflix.discovery.shared.transport.decorator.RedirectingEurekaHttpClient.execute(RedirectingEurekaHttpClient.java:79)
        at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.register(EurekaHttpClientDecorator.java:56)
        at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$1.execute(EurekaHttpClientDecorator.java:59)
        at com.netflix.discovery.shared.transport.decorator.RetryableEurekaHttpClient.execute(RetryableEurekaHttpClient.java:119)
        at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.register(EurekaHttpClientDecorator.java:56)
        at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$1.execute(EurekaHttpClientDecorator.java:59)
        at com.netflix.discovery.shared.transport.decorator.SessionedEurekaHttpClient.execute(SessionedEurekaHttpClient.java:77)
        at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.register(EurekaHttpClientDecorator.java:56)
        at com.netflix.discovery.DiscoveryClient.register(DiscoveryClient.java:798)
        at com.netflix.discovery.InstanceInfoReplicator.run(InstanceInfoReplicator.java:104)
        at com.netflix.discovery.InstanceInfoReplicator$1.run(InstanceInfoReplicator.java:88)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.ConnectException: Connection refused: connect
        at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
        at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.net.Socket.connect(Socket.java:589)
        at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:121)
        at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
        at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:144)
        at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:134)
        at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:610)
        at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:445)
        at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835)
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:118)
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
        at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:173)
        ... 30 common frames omitted
4

2 回答 2

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

此警告消息意味着您的应用程序无法连接到其 Spring Cloud 配置服务器:JHipster Registry。

开发配置文件中,这只是一个您可以忽略的警告,因为您的应用程序可以使用本地应用程序属性在sc/main/resources/config.

prod配置文件中,这将是一个错误,您的应用程序将无法启动。注册表必须在您的应用程序之前启动,因为这是您的应用程序从中获取其应用程序属性并将自己注册为 Eureka 客户端的地方。

所以在开发中,你可以忽略这个警告,或者如果它让你烦恼,你可以启动一个注册表。

如果您的应用程序是单体应用程序而不是微服务应用程序,您可以选择退出发现客户端问题,如果您不需要水平扩展,部署会更简单。

于 2017-07-14T09:29:14.630 回答
0

尽管我之前已经生成并修改了我的项目,但我也遇到了同样的问题。

如果您使用的是 MySql,请转到 phpMyAdmin 页面并输入您的凭据。为我工作。

于 2018-07-23T09:51:41.740 回答