alibaba / spring-cloud-alibaba

Spring Cloud Alibaba provides a one-stop solution for application development for the distributed solutions of Alibaba middleware.
https://sca.aliyun.com
Apache License 2.0
27.94k stars 8.33k forks source link

socket shutdown exception #1869

Open ReactorReddog opened 3 years ago

ReactorReddog commented 3 years ago

2020-12-15 22:58:54.751 ERROR 9330 --- [g.push.receiver] com.alibaba.nacos.client.naming : [NA] error while receiving push data

java.net.SocketException: Socket closed at java.base/java.net.PlainDatagramSocketImpl.receive0(Native Method) ~[na:na] at java.base/java.net.AbstractPlainDatagramSocketImpl.receive(AbstractPlainDatagramSocketImpl.java:181) ~[na:na] at java.base/java.net.DatagramSocket.receive(DatagramSocket.java:864) ~[na:na] at com.alibaba.nacos.client.naming.core.PushReceiver.run(PushReceiver.java:83) ~[nacos-client-1.3.3.jar:na] at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[na:na] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na] at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[na:na] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) ~[na:na] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) ~[na:na] at java.base/java.lang.Thread.run(Thread.java:832) ~[na:na]

这个不知是bug还是小弟我操作异常 但是小弟我愿意试试

theonefx commented 3 years ago

please provide more details.

HeyChiang commented 2 years ago

I have the same problem,this is my bootstrap.yml

spring:
  cloud:
    nacos:
      config:
        password: nacos
        username: nacos
        context-path: /nacos
        server-addr: 127.0.0.1:8848
        file-extension: yml
  application:
    name: gateway
  profiles:
    active: dev

gateway-dev.yml in the nacos config

spring:
  cloud:
    nacos:
      discovery:
        username: nacos
        password: nacos
        server-addr: 127.0.0.1:8848
        namespace: public

my pom.xml

 <properties>
        <java.version>11</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <spring-boot.version>2.3.7.RELEASE</spring-boot.version>
        <spring-cloud-alibaba.version>2.2.2.RELEASE</spring-cloud-alibaba.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
        </dependency>
        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

error info

2021-12-10 09:46:40.034 ERROR 8420 --- [g.push.receiver] com.alibaba.nacos.client.naming          : [NA] error while receiving push data

java.net.SocketException: socket closed
    at java.base/java.net.DualStackPlainDatagramSocketImpl.socketReceiveOrPeekData(Native Method) ~[na:na]
    at java.base/java.net.DualStackPlainDatagramSocketImpl.receive0(DualStackPlainDatagramSocketImpl.java:124) ~[na:na]
    at java.base/java.net.AbstractPlainDatagramSocketImpl.receive(AbstractPlainDatagramSocketImpl.java:181) ~[na:na]
    at java.base/java.net.DatagramSocket.receive(DatagramSocket.java:814) ~[na:na]
    at com.alibaba.nacos.client.naming.core.PushReceiver.run(PushReceiver.java:83) ~[nacos-client-1.3.2.jar:na]
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[na:na]
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]
    at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[na:na]
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
    at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]