Menu Plugin - ClassCastException: brix.plugin.menu.editor.MenuTreeNode

2 views
Skip to first unread message

James McIntosh

unread,
Sep 28, 2010, 7:00:33 AM9/28/10
to brix-cms-discuss
I'm seeing the following stack when trying to add a new menu item
after upgrading to wicket 1.4.12.

Is anyone else seeing this issue or diagnosed it yet?

java.lang.ClassCastException: brix.plugin.menu.editor.MenuTreeNode
cannot be cast to javax.swing.tree.TreeNode
at
org.apache.wicket.markup.html.tree.AbstractTree.treeNodesInserted(AbstractTree.java:
823)
at
brix.web.tree.AbstractTreeModel.nodeInserted(AbstractTreeModel.java:
138)
at brix.plugin.menu.editor.MenuEditor$5.onClick(MenuEditor.java:194)
at org.apache.wicket.ajax.markup.html.AjaxLink
$1.onEvent(AjaxLink.java:68)
at
org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:
177)
at
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:
300)
at
org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:
119)

Korbinian

unread,
Sep 28, 2010, 7:13:37 AM9/28/10
to brix-cms-discuss
what version ob Brix you are on?

Brian Topping

unread,
Sep 29, 2010, 1:59:33 AM9/29/10
to brix-cms...@googlegroups.com
Could unit tests be developed for these?

> --
> You received this message because you are subscribed to the Google Groups "brix-cms-discuss" group.
> To post to this group, send email to brix-cms...@googlegroups.com.
> To unsubscribe from this group, send email to brix-cms-discu...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/brix-cms-discuss?hl=en.
>

James McIntosh

unread,
Sep 29, 2010, 2:33:59 AM9/29/10
to brix-cms-discuss
brix version 1.2.2

Korbinian

unread,
Sep 29, 2010, 3:03:58 PM9/29/10
to brix-cms-discuss, Igor Vaynberg
I found the problem: WICKET-2886 is the one!

It breaks everything that expects a Model holding a TreeNode as a
Swing TreeNode is now used explicitly, see patch lines:
...
+import javax.swing.tree.TreeNode;
...
// get the parent node of inserted nodes
- Object parent = e.getTreePath().getLastPathComponent();
+ TreeNode parentNode =
(TreeNode)e.getTreePath().getLastPathComponent();

- if (isNodeVisible(parent) && isNodeExpanded(parent))
+ if (isNodeVisible(parentNode))
{

....

IMHO wicket 1.4 should revert the patch as it will break all Tree's
out there that expect the old Object parent and not the TreeNode from
Swing;

Any comments?

James McIntosh

unread,
Sep 30, 2010, 6:53:50 AM9/30/10
to brix-cms-discuss
I agree with it not expecting a TreeNode but more careful
consideration of the new bug and a re-implementation of the previous
patch is the proper course of action rather than just reverting the
patch. I say this because the build has been released, this can't be
taken back and there was a reason for this path, another bug which
still needs to be addressed.

I'll have a look at it over this weekend in more depth as I have a
couple of other components which also have custom trees in other
wicket projects which will also be affected upon moving to the new
wicket versions.

James

danisevsky

unread,
Oct 10, 2010, 8:53:00 AM10/10/10
to brix-cms-discuss
Could I ask you what is the status of this bug? Is it reported to the
wicket jira?
Reply all
Reply to author
Forward
0 new messages