Issue Details (XML | Word | Printable)

Key: CACTUS-21
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Vincent Massol
Reporter: Marc Brette
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Cactus

HttpSession is not setup

Created: 30/Apr/02 02:29 PM   Updated: 17/Apr/04 04:15 PM
Return to search
Component/s: Framework
Affects Version/s: 1.3
Fix Version/s: 1.4-beta1

Time Tracking:
Not Specified

Environment:
Operating System: Windows NT/2K
Platform: PC

Bugzilla Id: 8640


 Description  « Hide
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.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Vincent Massol added a comment - 24/May/02 02:09 AM
Thanks Marc. Fixed in Cactus 1.4dev.

Vincent Massol added a comment - 13/Jun/02 03:45 PM
*** Bug 9785 has been marked as a duplicate of this bug. ***

Serge Knystautas made changes - 20/Mar/04 07:01 PM
Field Original Value New Value
issue.field.bugzillaimportkey 8640 15798
Vincent Massol made changes - 17/Apr/04 04:14 PM
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.
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.
Fix Version/s 1.4-beta1 [ 10692 ]
Environment Operating System: Windows NT/2K
Platform: PC
Operating System: Windows NT/2K
Platform: PC
Priority Major [ 3 ]
Vincent Massol made changes - 17/Apr/04 04:15 PM
Status Resolved [ 5 ] Closed [ 6 ]