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



      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: 
      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: 


        1. liferay.2019-06-14.log
          605 kB
          Summer Zhang
        2. spring-mvc-portlet.war
          4.36 MB
          Eric Yan
        3. stacktrace.log
          22 kB
          Eric Yan

        Issue Links



              summer.zhang Summer Zhang
              eric.yan Eric Yan
              Kiyoshi Lee Kiyoshi Lee
              0 Vote for this issue
              2 Start watching this issue


                3 years, 14 weeks, 3 days ago


                  Version Package
                  7.0.0 DXP FP87
         DXP SP12
                  7.1.10 DXP FP13
                  7.2.10 DXP FP1
                  7.2.1 CE GA2
                  7.3.10 DXP GA1