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:[EMAIL PROTECTED] > 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]