Em Mon, 02 Mar 2009 17:26:32 -0300, Carl Crowder <carl.crow...@taptu.com> escreveu:

This is just a vague guess, but as far as I *think* that class name isn't the only thing Java uses to compare two classes when casting. So if you have defined your TreeNode class in more than once place, it's possible that the class you're passing it and the class Tapestry is trying to use were loaded by different classloaders from different places.

This is not a vague guess, it is a very correct explanation. Tapestry loads page, component and mixin classes using a special classloader that changes them on the fly. That's why you must never, never, ever put a class or interface that is not a component in the components, pages, or mixins package. That's also why you cannot instantiate a component, page or mixin in your package: you must let Tapestry to do that.

The solution is to move the TreeNode class and ITree interface to another package. ;)

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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

Reply via email to