You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Steve O'Hara <so...@pivotal-solutions.co.uk> on 2005/02/09 12:11:38 UTC

VelocityViewServlet Differences with VelocityServlet

I've taken the advice offered by everyone to switch to using the
VelocityViewServlet but I've got a strange error occurring which didn't
happen with VelocityServlet (or if it did, it was caught).

When I log out from my application I clear the session object by doing a
session().invalidate()
Now, when the template for the logout screen is merged by Velocity. I get
the following error;

java.lang.IllegalStateException: getAttribute: Session already invalidated

I can't understand this, I don't refer to the session object in my template
so why is the VelocityViewServlet checking the session object?  Also, why
doesn't it catch this error gracefully?

Steve




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


RE: VelocityViewServlet Differences with VelocityServlet

Posted by Steve O'Hara <so...@pivotal-solutions.co.uk>.
Hi Nathan,

Here's the trace:-

java.lang.IllegalStateException: getAttribute: Session already invalidated
	at
org.apache.catalina.session.StandardSession.getAttribute(StandardSession.jav
a:900)
	at
org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessi
onFacade.java:171)
	at
org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessi
onFacade.java:171)
	at
org.apache.velocity.tools.view.context.ChainedContext.getAttribute(ChainedCo
ntext.java:194)
	at
org.apache.velocity.tools.view.context.ChainedContext.internalGet(ChainedCon
text.java:176)
	at
org.apache.velocity.context.AbstractContext.get(AbstractContext.java:200)
	at
org.apache.velocity.context.InternalContextAdapterImpl.get(InternalContextAd
apterImpl.java:162)
	at
org.apache.velocity.runtime.parser.node.ASTReference.getVariableValue(ASTRef
erence.java:623)
	at
org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.ja
va:151)
	at
org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.jav
a:220)
	at
org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:55)
	at
org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement
.java:70)
	at
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:23
0)
	at org.apache.velocity.Template.merge(Template.java:256)
	at
org.apache.velocity.tools.view.servlet.VelocityViewServlet.mergeTemplate(Vel
ocityViewServlet.java:592)
	at
org.apache.velocity.tools.view.servlet.VelocityViewServlet.doRequest(Velocit
yViewServlet.java:417)
	at
org.apache.velocity.tools.view.servlet.VelocityViewServlet.doGet(VelocityVie
wServlet.java:373)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:243)
	at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:190)
	at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
	at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2
46)
	at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
	at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
	at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:170)
	at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170
)
	at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
	at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
	at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
	at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
1027)
	at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125
)
	at java.lang.Thread.run(Thread.java:536)

thanks,

Steve

-----Original Message-----
From: Nathan Bubna [mailto:nbubna@gmail.com]
Sent: 09 February 2005 17:14
To: Velocity Users List; sohara@pivotal-solutions.co.uk
Subject: Re: VelocityViewServlet Differences with VelocityServlet


hmm.  i've not had problems with invalidated sessions before.  can you
give us some of that stack trace?  i wanna see where this is
happening.

On Wed, 9 Feb 2005 11:11:38 -0000, Steve O'Hara
<so...@pivotal-solutions.co.uk> wrote:
>
> I've taken the advice offered by everyone to switch to using the
> VelocityViewServlet but I've got a strange error occurring which didn't
> happen with VelocityServlet (or if it did, it was caught).
>
> When I log out from my application I clear the session object by doing a
> session().invalidate()
> Now, when the template for the logout screen is merged by Velocity. I get
> the following error;
>
> java.lang.IllegalStateException: getAttribute: Session already invalidated
>
> I can't understand this, I don't refer to the session object in my
template
> so why is the VelocityViewServlet checking the session object?  Also, why
> doesn't it catch this error gracefully?
>
> Steve
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>

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




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


Re: VelocityViewServlet Differences with VelocityServlet

Posted by Nathan Bubna <nb...@gmail.com>.
hmm.  i've not had problems with invalidated sessions before.  can you
give us some of that stack trace?  i wanna see where this is
happening.

On Wed, 9 Feb 2005 11:11:38 -0000, Steve O'Hara
<so...@pivotal-solutions.co.uk> wrote:
> 
> I've taken the advice offered by everyone to switch to using the
> VelocityViewServlet but I've got a strange error occurring which didn't
> happen with VelocityServlet (or if it did, it was caught).
> 
> When I log out from my application I clear the session object by doing a
> session().invalidate()
> Now, when the template for the logout screen is merged by Velocity. I get
> the following error;
> 
> java.lang.IllegalStateException: getAttribute: Session already invalidated
> 
> I can't understand this, I don't refer to the session object in my template
> so why is the VelocityViewServlet checking the session object?  Also, why
> doesn't it catch this error gracefully?
> 
> Steve
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 
>

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