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

IllegalStateException is thrown when accessing a page with a WAB using Spring MVC and while simultaneously re-deploying the same WAB

    Details

      Description

      Description
      When a page with a WAB using Spring MVC is frequently being viewed and the WAB is being re-deployed at the same time, an IllegalStateException may be thrown.

      Steps to Reproduce

      1. Startup Liferay
      2. Deploy attached spring-mvc-portlet.war (Created using Blade - Notes Below)
      3. Add the SpringMvc portlet to the home page
      4. Verify the following URL navigates directly to the portlet: http://localhost:8080/widget/web/guest/home/-/springmvc_WAR_springmvcportlet
      5. Run the following script to simulate users accessing the site:
        for i in `seq 1 10000`; do curl -s "http://localhost:8080/widget/web/guest/home/-/springmvc_WAR_springmvcportlet" 2>&1 >> /dev/null; sleep 0.01; done

        Note: This script uses curl to request for the portlet page every 0.01s and will execute this 10000 times

      1. Open Gogo Shell
      2. Find the bundle id for spring-mvc-portlet bundle by using the command:
        ss | grep spring-mvc-portlet
      1. Refresh the spring-mvc-portlet bundle by using the command:
        refresh [bundle-id]

        Note: Replace [bundle-id] with the bundle id from Step 7 

      1. If errors are observed, stop the script from running (Step 5)
        • Note: Normally, you can stop the script by pressing ctrl+c in the terminal
      2. If errors are not observed, continue to refresh the bundle (Step 8)

      Expected Behavior
      No errors are thrown and portlet continues to work as expected

      Actual Behavior
      IllegalStateException is thrown and the portlet no longer works

      Stack trace: stacktrace.log


      Steps to create attached SpringMVC WAB sample

      1. Install Liferay Blade CLI: 
        https://dev.liferay.com/en/develop/tutorials/-/knowledge_base/7-1/blade-cli
      2. Create blade sample project by running the command:
        blade create -t spring-mvc-portlet spring-mvc-portlet

        Note: This generates a project folder: spring-mvc-portlet

      1. Navigate to the created spring-mvc-portlet in terminal
      2. Run the following command to compile/generate the WAR file:
        gw war

        Note: The deployed WAR file will be converted to a WAB when deployed on Liferay

      1. The generated WAR should be located in: 
        build/libs/spring-mvc-portlet.war

        Attachments

        1. stacktrace.log
          22 kB
        2. spring-mvc-portlet-src.zip
          102 kB
        3. spring-mvc-portlet.war
          4.36 MB
        4. liferay.2019-06-14.log
          605 kB

          Issue Links

            Activity

              People

              • Assignee:
                summer.zhang Summer Zhang
                Reporter:
                eric.yan Eric Yan
                Participants of an Issue:
                Recent user:
                Jason Pince
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  40 weeks, 5 days ago

                  Packages

                  Version Package
                  7.0.0 DXP FP87
                  7.0.10.12 DXP SP12
                  7.0.X
                  7.1.10 DXP FP13
                  7.1.X
                  7.2.10 DXP FP1
                  7.2.X
                  7.2.1 CE GA2
                  Master