Struts 2
  1. Struts 2
  2. WW-3056

getAttribute: Session already invalidated>java.lang.IllegalStateException: getAttribute: Session already invalidated

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Not a Problem
    • Affects Version/s: 2.1.6
    • Fix Version/s: None
    • Component/s: Other
    • Labels:
      None
    • Environment:

      Struts2
      TC 6.0.14
      J2SE 6.0

      Description

      [WARN] OgnlValueStack - Could not find property [theme]
      [WARN] OgnlValueStack - Caught an exception while evaluating expression '#attr.t
      heme' against value stack <java.lang.IllegalStateException: getAttribute: Sessio
      n already invalidated>java.lang.IllegalStateException: getAttribute: Session alr
      eady invalidated
      at org.apache.catalina.session.StandardSession.getAttribute(StandardSess
      ion.java:1032)
      at org.apache.catalina.session.StandardSessionFacade.getAttribute(Standa
      rdSessionFacade.java:110)
      at org.apache.jasper.runtime.PageContextImpl.doFindAttribute(PageContext
      Impl.java:465)
      at org.apache.jasper.runtime.PageContextImpl.findAttribute(PageContextIm
      pl.java:450)
      at org.apache.struts2.util.AttributeMap.get(AttributeMap.java:97)

      org.apache.struts2.util.AttributeMap
      AttributeMap does not test for IES ..suggested workaround which works on my box:
      public Object get(Object key)
      {
      PageContext pc = getPageContext();

      if (pc == null)
      { //start pc == null
      Map request = (Map) context.get("request");
      try
      { //start 1st try
      Map session = (Map) context.get("session");
      //Map application = (Map) context.get("application");
      if ((request != null) && (request.get(key) != null))

      { return request.get(key); }

      else if ((session != null) && (session.get(key) != null))

      { return session.get(key); }

      } //end 1st try
      catch(java.lang.IllegalStateException ise)

      { System.out.println("org.apache.struts2.util.AttributeMap get has produced IllegalStateException message="+ise.getMessage()); }

      Map application = (Map) context.get("application");
      //} else
      if ((application != null) && (application.get(key) != null)) return application.get(key);
      }
      else
      { //start else
      try

      { return pc.findAttribute(key.toString()); }

      catch (NullPointerException npe)

      { return null; }

      catch (java.lang.IllegalStateException ise)

      { return null; }

      } //end else

      return null;
      }

      MCG 03/22/09

        Activity

        Hide
        musachy added a comment -

        please ask questions on the mailing list. this error happens when a session is accessed after being invalidated.

        Show
        musachy added a comment - please ask questions on the mailing list. this error happens when a session is accessed after being invalidated.

          People

          • Assignee:
            Unassigned
            Reporter:
            Martin Gainty
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development