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

java.lang.IllegalStateException: getAttribute: Session already invalidated

    Details

    • Story Points:
      1.5
    • Fix Priority:
      3

      Description

      Steps to reproduce - environment setup

      1. Download and install attached login-liferay.zip script:
        • Unzip file to a empty folder
        • Install node.js and npm if necessary
        • Execute npm install
      2. Configure Liferay cluster with two tomcat nodes.
      3. Edit $TOMCAT_HOME/conf/server.xml of each node and configure the tcp ports to "8080" and "8180"
      4. Activate session replication at tomcat level:
        1. Edit $TOMCAT_HOME/conf/server.xml of each node and inside Engine tag, add following text:
          <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
          
        2. Edit $TOMCAT_HOME/conf/context.xml of each node and inside Context tag, add following text:
              <Manager className="org.apache.catalina.ha.session.DeltaManager"
                       expireSessionsOnShutdown="false"
                       notifyListenersOnReplication="true"/>
          
        3. Edit $TOMCAT_HOME/webapps/ROOT/WEB-INF/web.xml and immediately following the <web-app> tag, add the tag <distributable />
        4. Edit $TOMCAT_HOME/conf/logging.properties and add the following lines.
          ##CLUSTER LOG
          5cluster.org.apache.juli.AsyncFileHandler.level = FINER
          5cluster.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
          5cluster.org.apache.juli.AsyncFileHandler.prefix = cluster.
          
          # just the clustering logs - all others are stock logging.properties
          org.apache.catalina.tribes.MESSAGES.level = FINE
          org.apache.catalina.tribes.MESSAGES.handlers = 5cluster.org.apache.juli.AsyncFileHandler
          
          org.apache.catalina.tribes.level = FINE
          org.apache.catalina.tribes.handlers = 5cluster.org.apache.juli.AsyncFileHandler
          
          org.apache.catalina.ha.level = FINE
          org.apache.catalina.ha.handlers = 5cluster.org.apache.juli.AsyncFileHandler
          
          org.apache.catalina.ha.deploy.level = INFO
          org.apache.catalina.ha.deploy.handlers = 5cluster.org.apache.juli.AsyncFileHandler
          
        5. Also add 5cluster.org.apache.juli.AsyncFileHandler to handlers line at the beggining of the file.

      Steps to reproduce - using login-liferay.zip script

      1. Start first tomcat node
      2. Verify you can login from browser using URL: http://localhost:8080/web/guest
      3. In a new console, execute login-liferay script, in order to generate new sessions and force replication to second node
        • 6.2.x:
          node login-liferay.js -u test@liferay.com -p test --url "http://localhost:8080/web/guest" --num_threads 6 --num_executions 1000 --version 62
          
        • 7.0.x / master:
          node login-liferay.js -u test@liferay.com -p test --url "http://localhost:8080/web/guest" --num_threads 6 --num_executions 1000 --version 70
          
      4. Start second tomcat node:
        • Correct behavior: First node starts successfully
        • Wrong behavior: Second node starts but following error is continuously displayed
          05:56:33,399 ERROR [localhost-startStop-1][BasePortalLifecycle:47] java.lang.IllegalStateException: getAttribute: Session already invalidated
          java.lang.IllegalStateException: getAttribute: Session already invalidated
          	at org.apache.catalina.session.StandardSession.getAttribute(StandardSession.java:1190)
          	at org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessionFacade.java:103)
          	at com.liferay.chat.internal.events.SessionDestroyAction.run(SessionDestroyAction.java:38)
          	at com.liferay.portal.kernel.events.SessionAction.processLifecycleEvent(SessionAction.java:28)
          	at com.liferay.portal.events.EventsProcessorUtil.process(EventsProcessorUtil.java:98)
          	at com.liferay.portal.events.EventsProcessorUtil.process(EventsProcessorUtil.java:67)
          	at com.liferay.portal.servlet.PortalSessionDestroyer.doPortalInit(PortalSessionDestroyer.java:133)
          	at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:44)
          	at com.liferay.portal.kernel.util.PortalLifecycleUtil.flushInits(PortalLifecycleUtil.java:50)
          	at com.liferay.portal.servlet.MainServlet.initPlugins(MainServlet.java:902)
          	at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:410)
          	at javax.servlet.GenericServlet.init(GenericServlet.java:158)
          	at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1238)
          	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1151)
          	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1038)
          	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4997)
          	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5289)
          	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
          	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
          	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
          	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
          	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:585)
          	at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1794)
          	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
          	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
          	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
          	at java.lang.Thread.run(Thread.java:745)
          05:56:33,408 ERROR [localhost-startStop-1][MainServlet:413] java.lang.IllegalStateException: Unable to initialize portal
          java.lang.IllegalStateException: Unable to initialize portal
          	at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:49)
          	at com.liferay.portal.kernel.util.PortalLifecycleUtil.flushInits(PortalLifecycleUtil.java:50)
          	at com.liferay.portal.servlet.MainServlet.initPlugins(MainServlet.java:902)
          	at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:410)
          	at javax.servlet.GenericServlet.init(GenericServlet.java:158)
          	at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1238)
          	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1151)
          	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1038)
          	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4997)
          	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5289)
          	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
          	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
          	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
          	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
          	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:585)
          	at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1794)
          	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
          	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
          	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
          	at java.lang.Thread.run(Thread.java:745)
          Caused by: java.lang.IllegalStateException: getAttribute: Session already invalidated
          	at org.apache.catalina.session.StandardSession.getAttribute(StandardSession.java:1190)
          	at org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessionFacade.java:103)
          	at com.liferay.chat.internal.events.SessionDestroyAction.run(SessionDestroyAction.java:38)
          	at com.liferay.portal.kernel.events.SessionAction.processLifecycleEvent(SessionAction.java:28)
          	at com.liferay.portal.events.EventsProcessorUtil.process(EventsProcessorUtil.java:98)
          	at com.liferay.portal.events.EventsProcessorUtil.process(EventsProcessorUtil.java:67)
          	at com.liferay.portal.servlet.PortalSessionDestroyer.doPortalInit(PortalSessionDestroyer.java:133)
          	at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:44)
          	... 20 more
          

        Attachments

        1. login-liferay.zip
          2 kB
        2. node1.log
          196 kB
        3. node2.log
          121 kB

          Issue Links

            Activity

              People

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

                Dates

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

                  Packages

                  Version Package
                  Master