You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Martino Piccinato <ma...@gmail.com> on 2007/11/29 17:40:59 UTC

OGNL race condition(s) (?)

Hi all,

some time ago we had a strange problem with our tapestry application,
there was a component repeatedly throwing a ClassCastException, in
fact one of this component's parameter was passed
a User (interface) object being in that specific case a "SimpleUser"
concrete implementation. When using the component we had SimpleUser
ClassCastException on that binding evaluation.

The two strange things were that:

- the component was working perfectly with our previous application
version (note: we were using tapestry 4.0 and OGNL 2.6.9 for our
previous application version)
- and, definitely smore strange, the component was working perfectly
on all our workstations, on our development server and on our test
server, the only place where this problem was (always?) occurring was
on production whose only difference seemed to me to use a much more
powerful server (test server and production server have same
os/jvm/tapestry version/libraries/processor architecture/tomcat
version)

Having not been for this last strange thing, the problem would have
been relatively easily solved because in fact was that "User"
interface was missing a (needed) setter that the concrete
implementation "SimpleUser" had. As far as I understand Jesse did a
big work to remove/replace java reflection for new OGNL 2.7 so in fact
OGNL in this case was more "respectful" of the declared type and acted
consistently. .
What I still cannot explain is why the issue was happening just on
production and could not be replicated anywhere else (and there goes
for the supposed race condition)

I'm writing this also because we have now having a similar problem,
meaning the the only similarity is the fact that it happens on
production server and not on any other host, in fact it looks like an
"innocuous"

Exception: Unable to parse OGNL expression 'role.user': source is null
for getProperty(null, "user")
org.apache.tapestry.BindingException
Unable to parse OGNL expression 'role.user': source is null for
getProperty(null, "user")

but still: all evidences shows that "source" shouldn't be null at that
point and the bug could not be reproduced outside production server
(where it always happens...)
I suspect this to be something similar, still investigating.

Has anyone incurred in anything similar?

Tnx

Martino

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: OGNL race condition(s) (?)

Posted by Matt Brock <br...@gmail.com>.
I've also noticed more OGNL getProperty(null, "property") exceptions while
upgrading from 4 to 4.1.  For instance, previously this would work:


&lt;tr jwcid="@For" source="ognl:myObj.myCollection" value="ognl:tempObj"
id="ognl:'uniquerow' + tempObj.id"&gt;

&nbsp;&nbsp;...

&lt;/tr&gt;


But now it appears the tempObj isn't instantiated until after the rendering
of the component has begun, so I have to do this instead:


&lt;span jwcid="@For" source="ognl:myObj.myCollection" value="ognl:tempObj"
renderTag="false"&gt;

  &lt;tr id="ognl:'uniquerow' + tempObj.id"&gt;

    ...

  &lt;/tr&gt;

&lt;/span&gt;


Not quite the same problem, just confirming that there is some OGNL breakage
in the tap4->4.1 transition.
-- 
View this message in context: http://www.nabble.com/OGNL-race-condition%28s%29-%28-%29-tf4898454.html#a14132762
Sent from the Tapestry - User mailing list archive at Nabble.com.