You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-dev@jakarta.apache.org by ji...@apache.org on 2004/04/17 18:15:32 UTC

[jira] Closed: (CACTUS-21) HttpSession is not setup

Message:

   The following issue has been closed.

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/CACTUS-21

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: CACTUS-21
    Summary: HttpSession is not setup
       Type: Bug

     Status: Closed
   Priority: Major
 Resolution: FIXED

    Project: Cactus
 Components: 
             Framework
   Fix Fors:
             1.4-beta1
   Versions:
             1.3

   Assignee: Vincent Massol
   Reporter: Marc Brette

    Created: Tue, 30 Apr 2002 7:29 AM
    Updated: Sat, 17 Apr 2004 9:15 AM
Environment: Operating System: Windows NT/2K
Platform: PC

Description:
Hi,
I have just updated to Cactus 1.3 and the following code throws an exception
:

public class Testresults extends JspTestCase {
...
  protected void setUp() throws Exception { 
    // Setup the needed beans
    // JSPDataConstants.initializeConstants(pageContext) ;
    SessionBean sessionBean = new SessionBean() ;
    pageContext.setAttribute("sessionBean",
sessionBean,PageContext.SESSION_SCOPE) ;
  }
...
java.lang.IllegalArgumentException: can't access SESSION_SCOPE without an
HttpSession
 at
org.apache.jasper.runtime.PageContextImpl.setAttribute(PageContextImpl.java:
244)
 at
org.apache.cactus.server.AbstractPageContextWrapper.dispatch63_setAttribute
AbstractPageContextWrapper.java;org/apache/cactus/util/log/LogAspect.java(1k
):319)
 at
org.apache.cactus.server.AbstractPageContextWrapper.around63_setAttribute(Ab
stractPageContextWrapper.java;org/apache/cactus/util/log/LogAspect.java(1k):
1147)
 at
org.apache.cactus.server.AbstractPageContextWrapper.setAttribute(AbstractPag
eContextWrapper.java;org/apache/cactus/util/log/LogAspect.java(1k):316)
 at Testresults.setUp(Testresults.java:86)
 at
org.apache.cactus.AbstractTestCase.runBareServerTest(AbstractTestCase.java:4
88)
 at
org.apache.cactus.server.AbstractTestCaller.doTest(AbstractTestCaller.java:1
48)
...

It worked with Cactus previous version, but I remember I had to change the
jspRedirector.jsp first line to
<%@page import="org.apache.cactus.server.*" session="true" %> (the original
version states session="false")

I made this change because I had a similar exception and saw this advice on
cactus mailing list.


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-dev-help@jakarta.apache.org