You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Martin Gainty (JIRA)" <ji...@apache.org> on 2009/03/22 16:56:02 UTC

[jira] Created: (WW-3056) getAttribute: Session already invalidated>java.lang.IllegalStateException: getAttribute: Session already invalidated

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

                 Key: WW-3056
                 URL: https://issues.apache.org/struts/browse/WW-3056
             Project: Struts 2
          Issue Type: Bug
          Components: Other
    Affects Versions: 2.1.6
         Environment: Struts2
TC 6.0.14
J2SE 6.0
            Reporter: Martin Gainty
            Priority: Minor


[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


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WW-3056) getAttribute: Session already invalidated>java.lang.IllegalStateException: getAttribute: Session already invalidated

Posted by "Musachy Barroso (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-3056?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Musachy Barroso resolved WW-3056.
---------------------------------

    Resolution: Not A Problem

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

> getAttribute: Session already invalidated>java.lang.IllegalStateException: getAttribute: Session already invalidated
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3056
>                 URL: https://issues.apache.org/struts/browse/WW-3056
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: 2.1.6
>         Environment: Struts2
> TC 6.0.14
> J2SE 6.0
>            Reporter: Martin Gainty
>            Priority: Minor
>
> [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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.