Thanks, I've re-opened the bug and will take a look. On 7/10/07, Damien Uern <[EMAIL PROTECTED]> wrote:
Hello, I recently upgraded to OGNL 2.7, Tapestry 4.1.2 and am experiencing the same issue described here http://jira.opensymphony.com/browse/OGNL-11. The original poster didn't seem to provide much information, so I have added a comment to that bug describing the issue I am having. I'm not sure if I need to open a new bug in order for somebody to look at it. I will reproduce my comment here for convenience, any help/workarounds would be most appreciated: I have just updated from Tapestry 4.0 to 4.1.2 with OGNL 2.7 and I am having this same class cast exception on an ASTChain generated class, stack trace is here: Caused by: java.lang.ClassCastException: com.jigsawpublications.common.tapestry.menu.ActionLinkNode at $ASTChain_113aed5c33f.get($ASTChain_113aed5c33f.java) at org.apache.tapestry.services.impl.ExpressionEvaluatorImpl.read( ExpressionEvaluatorImpl.java:142) What we have in the component template looks like this: <span jwcid="[EMAIL PROTECTED]"> <li> <a jwcid="@DirectLink" listener="listener:callParentAction" parameters="ognl:getNodeIter().getAction()" href="#" title="ognl:nodeIter.title"> <span jwcid="@Insert" value="ognl:nodeIter.title" /> </a> </li> </span> The nodeIter property on the component class is declared as follows: public IMenuNode getNodeIter() { ....} So what we have here is a list of objects all implementing this interface IMenuNode, and getNodeIter() returns the current iteration as set by the tapestry @For component. The class cast exception was on an ActionLinkNode which implements that interface. Other classes are PageLinkNode, RootNode and MenuNode. The *only* one that causes a problem seems to be the above @Block component, as another block: <span jwcid="[EMAIL PROTECTED]"> <li> <a jwcid="@PageLink" href="#" title="ognl:nodeIter.title" page="ognl:nodeIter.page"> <span jwcid="@Insert" value="ognl:nodeIter.title" /> </a> </li> </span> renders fine without any issue (these other blocks occur earlier in the page than the ActionLinkBlock). If I change the actionLink block to be the following (i.e. change the offending ognl expressions): <span jwcid="[EMAIL PROTECTED]"> <li> <a jwcid="@DirectLink" listener="listener:callParentAction" parameters="ognl:'action'" href="#" title="ognl:'title'"> <span jwcid="@Insert" value="ognl:'title'" /> </a> </li> </span> Then I do not get an exception during the page render. This worked fine with the previous version of ognl we were using (2.6.7). Please let me know if you require more information. Regards, Damien Uern -- Damien Uern Online Applications Developer Synect Online Solutions http://www.synect.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- Jesse Kuhnert Tapestry/Dojo team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com