tapestry-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patrick Casey" <patca...@adelphia.net>
Subject RE: @InjectObject spring beans proxyed with Spring-AOP problem.
Date Fri, 02 Sep 2005 06:47:23 GMT

	CGLIB is an enhancement library that a lot of open source packages
use to create dynamic proxies of your classes (usually to bolt on their
specific accessors and proxy code to your POJOs). It's used by both spring
and hibernate pretty extensively, and it looks like you've got spring
running. So what's happening is that spring is enhancing your class for you.

	*However* and this is the part where I get less helpful, an enhanced
class *should* be a subclass of the original class, hence it should still be
assignable. So, *in theory* you shouldn't get the error you're getting. In
theory, of course, theory and practice are the same.

	One (possible serious voodoo) things that often help:

	Make all the methods of your testService public (not package scope,
*public*).

	--- Pat

> -----Original Message-----
> From: Jun Tsai [mailto:Jun.Tsai@gmail.com]
> Sent: Thursday, September 01, 2005 11:48 PM
> To: Tapestry users
> Subject: Re: @InjectObject spring beans proxyed with Spring-AOP problem.
> 
> Jun Tsai wrote:
> > I find if I use
> >
> > @InjectObject("spring:testService")
> > public abstract ITestService getTestService();
> >
> > It throws a java.lang.IllegalArgumentException:
> >     argument type mismatch.
> >
> >
> > If I use
> > @InjectObject("spring:testService")
> > public abstract Object getTestService();
> >
> 
> 
> ITestService testService=(ITestService)getTestService();
> 
> The code throws java.lang.ClassCastException.I debug this.I find the
> class is TestService$$EnhanceByCGLIB$$b324af4b.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org




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


Mime
View raw message