cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alan Hodgkinson <a...@softxs.ch>
Subject [SUMMARY] Re: Cocoon runtime error: 'Session is required'
Date Fri, 06 Sep 2002 13:37:10 GMT

How to fix stacktrace with: 'Session is required'

I'm sending this short summary, which contains the dumb answer to 
a dumb question, so that:

- Other dummies know what to do when they make the same dumb mistake.
- One day when the trouble shooting guide is witten, this can be 
  part of it.

Alan Hodgkinson wrote:

> I'm trying to implement session based forms and have run into the
> following error:
> 
> ERROR   (2002-09-03) 18:56.26:764   [sitemap] (/tc/test-form.html)
> HttpProcessor[8080][4]/PipelineNode: Error while processing pipeline at
> jndi:/localhost/tc/sitemap.xmap:440:19
> org.apache.cocoon.ProcessingException: Exception in
> ServerPagesGenerator.generate(): java.lang.IllegalArgumentException:
> CreateContext: Session is required
> ..[snip]..
> 
> It seems that my xsp page (which is processed by the session transformer)
> is attempting to access session context without there being a session.
> I was under the (perhaps incorrect) assumption that when you use the
> session transformer that it creates a session if necessary. 

That is an incorrect assumption. The session must be explicitly created.

> The session documentation doesn't say very much on this issue.

Also wrong. Smacks self and repeats 'RTMF' 100 times! Look at:

http://localhost:8080/cocoon/documents/userdocs/actions/session-action.html

Where it states that you need to use the session action to create a 
session. Change the pipeline as follows:

>       <!-- Form Handler -->
> 
>       <map:match pattern="*-form.html">
>         <map:generate type="serverpages" src="xsp/{1}-form.xsp"/>
          <!-- The next line causes the session to be created -->
          <map:act type="session"/>
>         <map:transform type="session"/>
>         <map:transform src="xsp/form2html.xslt"/>
>         <map:transform src="xsp/simple-page2html.xsl"/>
>         <map:serialize/>
>       </map:match>

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message