Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mvn package failed for service-registry-v8 and v9 #3

Open
travis-hu-cn opened this issue Jul 7, 2020 · 1 comment
Open

mvn package failed for service-registry-v8 and v9 #3

travis-hu-cn opened this issue Jul 7, 2020 · 1 comment
Assignees

Comments

@travis-hu-cn
Copy link

travis-hu-cn commented Jul 7, 2020

Error occured while packaging (mvn package) microservices-v9/service-registry: https://github.com/microservices-practical/microservices-v9/tree/master/service-registry.

I noticed the following error message, and I am sure the port 8761 is free by executing "netstat -o | findstr 8761".

2020-07-07 12:46:57.367  INFO 16064 --- [           main] com.netflix.discovery.DiscoveryClient    : Getting all instance registry info from the eureka server
2020-07-07 12:47:01.523 ERROR 16064 --- [           main] 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) ~[jersey-apache-client4-1.19.1.jar:1.19.1]
...
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103) [surefire-booter-2.18.1.jar:2.18.1]
Caused by: java.net.ConnectException: Connection refused: connect
	at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method) ~[na:1.8.0_251]
...
	at java.net.Socket.connect(Socket.java:606) ~[na:1.8.0_251]
	at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:121) ~[httpclient-4.5.3.jar:4.5.3]
	at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180) ~[httpclient-4.5.3.jar:4.5.3]
	at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:144) ~[httpclient-4.5.3.jar:4.5.3]
	at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:134) ~[httpclient-4.5.3.jar:4.5.3]
	at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:610) ~[httpclient-4.5.3.jar:4.5.3]
	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:445) ~[httpclient-4.5.3.jar:4.5.3]
	at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835) ~[httpclient-4.5.3.jar:4.5.3]
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:118) ~[httpclient-4.5.3.jar:4.5.3]
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56) ~[httpclient-4.5.3.jar:4.5.3]
	at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:173) ~[jersey-apache-client4-1.19.1.jar:1.19.1]
	... 133 common frames omitted

Console output has been attached:
service-registry-package.log

I googled and noticed some posts said the application.properties should be :

server.port=8761
eureka.client.register-with-eureka=false
eureka.client.fetch-registry=false

after I modified, "mvn package" can pass, but encountered other issues while visiting the ui/index.html.

Please help on this. Thanks a lot !

@mechero
Copy link
Contributor

mechero commented Jul 7, 2020

Hi,

Did you add any further changes to the code or are you using the repository as-is? That error usually happens when the service registry can't register itself. The properties you added tell the service not to register, which should be also fine I guess. What other issues do you get in that case?

This line in the logs seems odd to me:

2020-07-07 12:47:06.406 ERROR 16064 --- [ Thread-12] com.netflix.discovery.DiscoveryClient : DiscoveryClient_SERVICE-REGISTRY/host.docker.internal:service-registry:-1 - de-registration failedCannot execute request on any known server

@mechero mechero self-assigned this Jul 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants