线程中的异常" main" org.springframework.web.client.ResourceAccessException:I / O错误 GET请求 " http://localhost:8081/FootballerShirt/footballerShirts":连接 拒绝:连接嵌套异常是java.net.ConnectException: 连接被拒绝:连接在 org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:525) 在 org.springframework.web.client.RestTemplate.execute(RestTemplate.java:473) 在 org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:238) 在 com.aucklanduni.spring.hibernate.HibernateFootballerShirtDaoMain.main(HibernateFootballerShirtDaoMain.java:44) 引起:java.net.ConnectException:连接被拒绝:连接在 java.net.DualStackPlainSocketImpl.connect0(Native Method)at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79) 在 java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) 在 java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) 在 java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) 在java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)at java.net.Socket.connect(Socket.java:579)at java.net.Socket.connect(Socket.java:528)at sun.net.NetworkClient.doConnect(NetworkClient.java:180)at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)at sun.net.www.http.HttpClient。(HttpClient.java:211)at sun.net.www.http.HttpClient.New(HttpClient.java:308)at sun.net.www.http.HttpClient.New(HttpClient.java:326)at at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:996) 在 sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:932) 在 sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:850) 在 org.springframework.http.client.SimpleBufferingClientHttpRequest.executeInternal(SimpleBufferingClientHttpRequest.java:76) 在 org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:48) 在 org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:49) 在 org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:510) ......还有3个
答案 0 :(得分:-2)
表示“http://localhost:8081/FootballerShirt/footballerShirts”:拒绝连接:
这只是意味着没有服务器侦听localhost上的端口8081。