こんにちは、2 つのマイクロサービス 1. spotparkin と 2. spotparking2 を作成しました。これらは eureka サーバーに正常に登録されました。その後、リボン クライアントを作成し、アプリケーション名 spotpaking を使用してレスト コールを試みました。これは、application.yml で指定したアプリケーション名です。両方のマイクロサービスのファイルですが、以下のエラーが発生しています:
2016-10-16 13:28:35.177 ERROR 11304 --- [nio-7213-exec-1] oaccC[.[.[/].[dispatcherServlet] : コンテキスト内のサーブレット [dispatcherServlet] の Servlet.service() with path [] が例外をスローしました [リクエストの処理に失敗しました。ネストされた例外は org.springframework.web.client.ResourceAccessException: I/O error on GE T request for " http://spotparking/spotparking/pincode ": spotparking; です。ネストされた例外は、根本原因を持つ java.net.UnknownHostException: spotparking] です
java.net.UnknownHostException: java.net.AbstractPlainSocketImpl.connect でのスポットパーキング (不明なソース) ~[na:1.8.0_101]
ParkingSpot parkingSpot = restTemplate.exchange("http://spotparking/spotparking/{pincode}",HttpMethod.GET,null,new ParameterizedTypeReference<ParkingSpot>() {}, pincode).getBody();
return new MessageWrapper<>(parkingSpot, "server called using eureka with rest template");
This is how it is comming up in eureka: