On Fri, 24 Feb 2012 08:23:47 -0200, Beat Durrer <bdur...@gmail.com> wrote:

Hey guys

Hi!

I just spent a whole day on a issue, where a service call in a page class
ended in a "java.lang.LinkageError: loader constraint violation the class
loader {...} of the current class, MyPage, and the class loader {...} for
resolved class, MyService, have different Class objects for the type used
in the signature"

What I did was totally stupid (at least in hindsight): I accidentally
passed the page object to the service:

MyPage{
    Object onSuccess(){
        return myService.doStuff(this);
    }
}

It's no suprise that that wouldn't work when accustomed to J2EE and remote stuff, althrough I didn't expect that to happen in T5.3.

This is a side-effect of having the page, component and mixins classes loaded by a different classloader inside Tapestry. So you have the normal classloader, which has the non-transformed version of the controlled classes, and the Tapestry one, which has the transformed versions. The Class instances for them are different. If you create an interface, implement it in your class and make the service receive this interface instead of the page type, I guess it would solve the problem.

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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

Reply via email to