You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Marinó A. Jónsson" <ma...@centrum.is> on 2004/03/17 20:40:23 UTC
Chained context on occation not initialized correctly ...
Hi guys,
I just came across the weirdest behaviour.
I am developing an online store and I use the TilesTool to assemble pages
from page components. I made the web-app accessible online to a client and
he immediately complained that one of the page components in one of the
pages didn't render correctly. Since I couldn't reproduce the bug on my
workstation and I found no error messages in the logs, he sent me a
screenshot. Then, after he had browsed the web-app for a while, the problem
silently went away and all was well. I got another guy to try it out - on
an apple computer - and he didn't have any trouble. The third guy however
(on another windows box) had the same trouble as the first guy.
It seems each of the page components gets imported ok - but for (at least)
one component none of the standard contexts (i.e. request, session, or
toolbox) are accessible. Many of the page components have their own
controller bean that populates them with data (using request or session
scope). Since TilesTool uses a RequestDispatcher to include resources each
page component has it's own Velocity context.
Which brings me to VelocityViewServlet and the ChainedContext ... the page
definition in question contains six components - so counting the layout page
it makes seven, almost simultaneous, calls to VelocityViewServlet for each
page. I took a look for myself but I couln't find anything that could shed
any light on this behaviour.
Any idea what could possibly be causing this?
Velocity 1.5-dev
Velocity Tools 1.2-dev
Struts 1.2-dev
Tomcat 4.1.29 & Tomcat 4.1.30
JDK 1.4.2
WinXP
cheers,
Marino
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org
Re: Chained context on occation not initialized correctly ...
Posted by Nathan Bubna <na...@esha.com>.
Marinó A. Jónsson said:
...
> > > I made the web-app accessible online to a client and
> > immediately...one
> > > component in one page didn't render correctly.
> >
> > is it always the same component in the same page? or the
> > same component in different pages? or different components
> > in the same page?
>
> at least the same component in different pages - I didn't get a chance to
> test it myself (I'm going to have a more rigorous session with them
> tomorrow).
i suspect this will be a key to finding the bug. if you can identify the
suffering component, strip the content to the others to a minimum, and change
the template/content for that component to something that clearly
tests/indicates what is available in that context and what is not, then that
would help a lot.
> > > another guy on an apple computer didn't have any trouble. third guy
> > > (on another windows box) had the same trouble as the first
> >
> > so, are these three guys are just pointing their browser to
> > it and getting different results based on browser/OS being
> > used? are the results for these different guys consistent?
> > are there any other factors different between them? (e.g.
> > different logins/accounts?)
>
> yes, they are only pointing their browsers to it and apparently getting
> different results, but I'm not sure it has anything to do with browser/OS
> (since the bug doesn't appear consistently on IE/Win - for the first guy the
> bug went away after the first few minutes)
well, given that it went away, i have to wonder if it isn't some sort of
session/initialization type problem. does the app make much use of sessions?
are there any session scoped tools?
with so few concurrent users i can't believe it would be any sort of load
problem. i suppose it could be some sort of concurrency problem (due to the
seven near-simultaneous requests (thru the request dispatcher) to the VVS, but
even there i'm still a bit skeptical.
...
> > > It seems each of the page components gets imported ok - but for (at
> > > least) one component none of the standard contexts (i.e. request,
> > > session, or
> > > toolbox) are accessible.
> >
> > can you try stripping down a version of the app to test this
> > theory? it might help narrow down the problem.
>
> the app is pretty compact so I'm not sure that would help much ... we'll
> see.
...
well, there may not be many other ways to find the bug. and for fixing it and
confirming the fix, being able to narrow things down to a simple test case is
critical.
Nathan Bubna
nathan@esha.com
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org
RE: Chained context on occation not initialized correctly ...
Posted by "Marinó A. Jónsson" <ma...@centrum.is>.
> is the app just running on one server or are these guys
> running it locally? is this your server setup? or their local setup?
I'm running the server from my workstation.
> > I made the web-app accessible online to a client and
> immediately...one
> > component in one page didn't render correctly.
>
> is it always the same component in the same page? or the
> same component in different pages? or different components
> in the same page?
at least the same component in different pages - I didn't get a chance to
test it myself (I'm going to have a more rigorous session with them
tomorrow).
> > another guy on an apple computer didn't have any trouble. third guy
> > (on another windows box) had the same trouble as the first
>
> so, are these three guys are just pointing their browser to
> it and getting different results based on browser/OS being
> used? are the results for these different guys consistent?
> are there any other factors different between them? (e.g.
> different logins/accounts?)
yes, they are only pointing their browsers to it and apparently getting
different results, but I'm not sure it has anything to do with browser/OS
(since the bug doesn't appear consistently on IE/Win - for the first guy the
bug went away after the first few minutes)
> and i'm on a windows box. if you wanna privately send me a
> url to see the prob for myself, i'd be happy to take a look.
cool :) ... I'll send the URL in a private mail in a minute.
> > after browsing for a while, the problem silently went away
> > I found no error messages in the logs
>
> ugh. damn sneaky bugs. can he/they recreate the problem
> again? by relogging in or restarting browser or clearing
> cache or cookies or anything?
they didn't have to log in or anything - just fire up and browse. The bug
didn't reappear for the first guy after it went away. All the info I have
right now is based on these three phonecalls and the single screenshot.
I'll know more tomorrow.
> > I couldn't reproduce the bug on my workstation
>
> again, pointing to the app on a server or just running
> locally on the workstation?
running locally on the workstation.
> > It seems each of the page components gets imported ok - but for (at
> > least) one component none of the standard contexts (i.e. request,
> > session, or
> > toolbox) are accessible.
>
> can you try stripping down a version of the app to test this
> theory? it might help narrow down the problem.
the app is pretty compact so I'm not sure that would help much ... we'll
see.
> > Many of the page components have their own
> > controller bean that populates them with data (using request or
> > session scope). Since TilesTool uses a RequestDispatcher to include
> > resources each page component has it's own Velocity context.
> >
> > Which brings me to VelocityViewServlet and the
> ChainedContext ... the
> > page definition in question contains six components - so
> counting the
> > layout page it makes seven, almost simultaneous, calls to
> > VelocityViewServlet for each page. I took a look for myself but I
> > couln't find anything that could shed any light on this behaviour.
> >
> > Any idea what could possibly be causing this?
>
> nope, i'm clueless at this point. and i'm still not even
> really sure what "this" is. :)
heh heh ... hope you have a better idea now :)
Marinó
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org
Re: Chained context on occation not initialized correctly ...
Posted by Nathan Bubna <na...@esha.com>.
Marinó A. Jónsson said:
> I just came across the weirdest behaviour.
> I use the TilesTool to assemble pages from page components.
ok, but i'm not sure i understand the problem/situation.
so i'm reorganizing the info below to get clarification.
and if i've misunderstood anything, please correct me.
> Velocity 1.5-dev
> Velocity Tools 1.2-dev
> Struts 1.2-dev
> Tomcat 4.1.29 & Tomcat 4.1.30
> JDK 1.4.2
> WinXP
is the app just running on one server or are these guys running it locally?
is this your server setup? or their local setup?
> I made the web-app accessible online to a client and
> immediately...one component in one page didn't render correctly.
is it always the same component in the same page? or the same component in
different pages? or different components in the same page?
> another guy on an apple computer didn't have any trouble.
> third guy (on another windows box) had the same trouble as the first
so, are these three guys are just pointing their browser to it and getting
different results based on browser/OS being used? are the results for these
different guys consistent? are there any other factors different between
them? (e.g. different logins/accounts?)
and i'm on a windows box. if you wanna privately send me a url to see the
prob for myself, i'd be happy to take a look.
> after browsing for a while, the problem silently went away
> I found no error messages in the logs
ugh. damn sneaky bugs. can he/they recreate the problem again? by relogging
in or restarting browser or clearing cache or cookies or anything?
> I couldn't reproduce the bug on my workstation
again, pointing to the app on a server or just running locally on the
workstation?
> It seems each of the page components gets imported ok - but for (at least)
> one component none of the standard contexts (i.e. request, session, or
> toolbox) are accessible.
can you try stripping down a version of the app to test this theory? it might
help narrow down the problem.
> Many of the page components have their own
> controller bean that populates them with data (using request or session
> scope). Since TilesTool uses a RequestDispatcher to include resources each
> page component has it's own Velocity context.
>
> Which brings me to VelocityViewServlet and the ChainedContext ... the page
> definition in question contains six components - so counting the layout page
> it makes seven, almost simultaneous, calls to VelocityViewServlet for each
> page. I took a look for myself but I couln't find anything that could shed
> any light on this behaviour.
>
> Any idea what could possibly be causing this?
nope, i'm clueless at this point. and i'm still not even really sure what
"this" is. :)
Nathan Bubna
nathan@esha.com
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org