【问题标题】:Spring boot rest api - connection reset?Spring Boot Rest api - 连接重置?
【发布时间】:2020-09-25 19:56:31
【问题描述】:

我需要一个需要生成“java.net.SocketException: Connection reset”错误的spring boot示例。

【问题讨论】:

    标签: spring rest connection reset


    【解决方案1】:

    为什么整个spring-boot项目要抛出异常?

    public static void main( String args[] ){
        try{
           doThrowSocketException(); 
        }catch{
            //Handle the exception
        }
        
    }
    
    private void doThrowSocketException() throws SocketException{
        throw new SocketException();
    }
    

    【讨论】:

      猜你喜欢
      • 2021-07-11
      • 1970-01-01
      • 1970-01-01
      • 2021-08-28
      • 2019-03-11
      • 2020-11-13
      • 2019-10-02
      • 2014-05-06
      相关资源
      最近更新 更多