Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-100274

Methods in ServletResponseUtil using NIO do not suppress SocketExceptions

    Details

      Description

      1. Add a non-suspending, logging breakpoint to com.liferay.portal.kernel.util.StreamUtil line 64 to simulate a SocketException being raised during calls to StreamUtil.cleanUp.
        ioException = (java.io.IOException)Class.forName("java.net.SocketException").newInstance()
        
      2. Startup Liferay
      3. Upload a Basic Document to the Documents and Media portlet
      4. Copy the download URL for the document
      5. Attach the debugger to your Tomcat server
      6. Paste the URL into the browser

      Expected behavior is that Liferay suppresses the error, as mentioned in LPS-40998.
      Actual behavior is that there is a stack trace in the console.

      2019-08-23 00:24:37.929 WARN  [http-nio-8080-exec-7][PortalImpl:6751] java.net.SocketException
      java.net.SocketException
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      	at java.lang.Class.newInstance(Class.java:442)
      	at com.liferay.portal.kernel.util.StreamUtil.cleanUp(StreamUtil.java:64)
      

        Attachments

          Activity

            People

            • Assignee:
              summer.zhang Summer Zhang
              Reporter:
              minhchau.dang Minhchau Dang
              Participants of an Issue:
              Recent user:
              Jason Pince
              Engineering Assignee:
              Minhchau Dang
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 4 weeks, 4 days ago

                Packages

                Version Package
                7.0.0 DXP FP86
                7.0.X
                7.1.10 DXP FP14
                7.1.X
                7.2.10 DXP FP2
                7.2.10.1 DXP SP1
                7.2.X
                7.2.1 CE GA2
                Master