PUBLIC - Liferay Portal Community Edition
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-30374

NullPointerException when Accessing Legacy URLs to Document Library Assets in 6.1 GA2

    Details

    • Branch Version/s:
      6.1.x
    • Backported to Branch:
      Committed
    • Liferay Contributor's Agreement:
      Accept
    • Similar Issues:
      Show 5 results 

      Description

      ISSUE
      Following an upgrade from Liferay 5.2 to 6.1 GA2, links generated by 5.2 to Document Library assets generates a NullPointerException and directs the browser to an "Internal Server Error" page.

      STEPS TO REPRODUCE
      Start off with clean Liferay 5.2 bundle connected to MySQL 5.5 db named "test"; portal-ext links db "test" and the following properties are added: "dl.hook.file.system.root.dir=F:/TEST" and "image.hook.impl=com.liferay.portal.image.DatabaseHook"

      1. Login with test
      2. Add Document Library (referenced hereafter as "DL Portlet")
      3. Add Folder to DL Portlet named Test
      4. Select Test folder, add document "test.pdf"
      5. test.pdf's URL is set as
      http://localhost:8080/c/document_library/get_file?p_l_id=10139&folderId=10166&name=DLFE-2.pdf
      6. Shutdown Server
      7. Copy portal-ext.properties to clean 6.1 GA 2 bundle, change the properties permissions.user.check.algorithm=5 and dl.store.file.system.root.dir=F:/TEST
      8. Upgrade takes place to db "test" as seen in console
      9. Convert via Data Migration in Control Panel, Shutdown Server after startup, change permissions.user.check.algorithm=6 and restart.
      10. "test.pdf" appears in Documents and Media Portlet ("DM Portlet") in their respective folders
      11. Attempt to access "test.pdf" via legacy link:
      http://localhost:8080/c/document_library/get_file?p_l_id=10139&folderId=10166&name=DLFE-2.pdf
      12. Internal Server Error appears and stack trace shows NPE:
      22:30:16,457 ERROR [http-bio-8080-exec-2][status_jsp:665] java.lang.NullPointerException
      java.lang.NullPointerException}}
      13. Check URL in DM Portlet, functional link to test.pdf exists at the following address:
      http://localhost:8080/documents/10136/10166/test.pdf/449a6b8b-6f2d-420f-b615-283099c3d752

      EXPECTED RESULTS
      Using legacy 5.2 link would reroute Document Library assets to new 6.1 link

      ACTUAL RESULTS
      Using legacy 5.2 link generates NullPointerException and shows Internal Server Error Page; however, the newly generated link works fine.

      TESTS IN TRUNK (124771)
      Not reproducible because I was unable to upgrade to Trunk.

      TESTS IN BRANCH (124771)
      Generates same behavior where we receive an NullPointerException and "Internal Server Error" page.

      OTHER NOTES
      I have tested a scenario upgrading 5.2 -> 6.0 -> 6.1. The legacy link generated in 5.2 works in 6.0, but once upgraded to 6.1 or Trunk, the legacy link no longer functions.

        Issue Links

          Activity

          Hide
          Sherry Yang added a comment -

          The issue fixed in 6.0.x by LPS-5400

          Show
          Sherry Yang added a comment - The issue fixed in 6.0.x by LPS-5400
          Hide
          Sherry Yang added a comment -

          This issue is caused by LPS-14028

          Show
          Sherry Yang added a comment - This issue is caused by LPS-14028
          Show
          Sherry Yang added a comment - https://github.com/hhuijser/liferay-portal/pull/936
          Hide
          Michael Saechang added a comment -

          Committed on:
          Portal 6.2.x GIT ID: eee69525f407e531ef0e403c861a2fbdba5127fc.

          Show
          Michael Saechang added a comment - Committed on: Portal 6.2.x GIT ID: eee69525f407e531ef0e403c861a2fbdba5127fc.
          Hide
          Sherry Yang added a comment -

          Should support file link , such as http://localhost:8080/c/document_library/get_file?p_l_id=10139&folderId=10166&name=DLFE-2.pdf, which is generated in old version of liferay (5.2.4).

          In 5.2.4, file could be fetched by folderId and name, which did not support in 6.x.x.

          In GetFileAction of 6.x.x, file could only be fetched by groupId, folderId and name. According to the link above, the groupId is not passed by URL so system uses scopedGroupId. That could generate the "file not found" issue cause a file with guest view permission could be accessed by other scopedGroup.

          Show
          Sherry Yang added a comment - Should support file link , such as http://localhost:8080/c/document_library/get_file?p_l_id=10139&folderId=10166&name=DLFE-2.pdf , which is generated in old version of liferay (5.2.4). In 5.2.4, file could be fetched by folderId and name, which did not support in 6.x.x. In GetFileAction of 6.x.x, file could only be fetched by groupId, folderId and name. According to the link above, the groupId is not passed by URL so system uses scopedGroupId. That could generate the "file not found" issue cause a file with guest view permission could be accessed by other scopedGroup.
          Hide
          Mark Jin added a comment -

          PASSED Manual Testing following the steps in the description.

          Reproduced on:
          Tomcat 7.0 + MySQL 5. Portal 6.1.20 EE GA2.

          Tomcat cause NPE error message and can't download the documents.

          Fixed on:
          Tomcat 7.0 + MySQL 5. Portal 6.1.x EE GIT ID: 8c09bf96a23c8bb3140093414ec3afe227f28390.
          Tomcat 7.0 + MySQL 5. Portal 6.2.x GIT ID: bb18c2770d0fcbd65e88ee556da0714727588f78.

          Unable to see NPE error message and able to download the documents.

          Show
          Mark Jin added a comment - PASSED Manual Testing following the steps in the description. Reproduced on: Tomcat 7.0 + MySQL 5. Portal 6.1.20 EE GA2. Tomcat cause NPE error message and can't download the documents. Fixed on: Tomcat 7.0 + MySQL 5. Portal 6.1.x EE GIT ID: 8c09bf96a23c8bb3140093414ec3afe227f28390. Tomcat 7.0 + MySQL 5. Portal 6.2.x GIT ID: bb18c2770d0fcbd65e88ee556da0714727588f78. Unable to see NPE error message and able to download the documents.
          Hide
          Michael Saechang added a comment -

          Thank you Mark for testing. Closing as 'Fixed'.

          Show
          Michael Saechang added a comment - Thank you Mark for testing. Closing as 'Fixed'.

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                2 years, 29 weeks, 5 days ago

                Development

                  Structure Helper Panel