|
From: Rod J. <rod...@in...> - 2003-12-16 11:51:26
|
Alef, I've fixed it--that is, your configuration, not Spring :-) The problem is that you expect the proxy to be of type Assembler, which is a class, not an interface, hence dynamic proxies can't work. Setting proxyTargetClass to be true in the two transactionFactoryProxies solves the problem. The reason it worked if it didn't implement the interface is that TransactionFactoryProxy bean realized that with no interfaces, it had to use CGLIB to proxy the class. I've checked in the changes. Regards, Rod ----- Original Message ----- From: "Alef Arendsen" <al...@jt...> To: <spr...@li...> Cc: <Jo...@jt...> Sent: Tuesday, December 16, 2003 11:21 AM Subject: RE: [Springframework-developer] Hibernate session and ApplicationContext > Ok, the story continues. > > Juergen, I've added a test to the context.support package, > ClasspathXmlApplicationContextTests. > > There are trhee contexts. B and C have to Logic beans in them. In A, > there are two Assembler beans, that both assemble a Service bean (also > defined in A) and a Logic bean (assemblerOne collaborates with logicOne, > assemblerTwo collaborates with logicTwo). Both Assembler beans are > wrapped by a TxProxyFactory (resulting in wrappedAssemblerOne and > wrappedAssemblerTwo). These are also defined in A. > > Then - and that's the issue - logicOne depends on wrappedAssemblerTwo, > logicTwo depends on wrappedAssemblerOne. This all goes well - until I > let Assembler implement _any_ interface. Right now, I've commented out > the implementation in Assembler of TestIF. Just uncomment it, run the > test, and it'll fail. As it is located in the CVS, it'll succeed! It > seems like the transactionmanager proxy does not implement all interface > or something a like. > > Exception: > > Can't resolve reference to bean 'logicOne' while setting property > 'logic' on bean 'assemblerOne'; nested exception is: > org.springframework.beans.FatalBeanException: Can't resolve > reference to bean 'wrappedAssemblerTwo' while setting property > 'assembler' on bean 'logicOne'; nested exception is: > org.springframework.beans.FatalBeanException: Can't resolve > reference to bean 'assemblerTwo' while setting property 'target' on bean > 'wrappedAssemblerTwo'; nested exception is: > org.springframework.beans.FatalBeanException: Can't resolve > reference to bean 'logicTwo' while setting property 'logic' on bean > 'assemblerTwo'; nested exception is: > PropertyVetoExceptionsException: 1 errors:-- > ErrorCodedPropertyVetoException: message=[Failed to convert property > value of type [$Proxy0] to required type > [org.springframework.context.support.Assembler] for property named > 'assembler'; nested exception is: > java.lang.IllegalArgumentException: argument type mismatch]; > errorCode=[typeMismatch] > > Hope this provides more info on the issue? > > Alef > > > > ------------------------------------------------------- > This SF.net email is sponsored by: IBM Linux Tutorials. > Become an expert in LINUX or just sharpen your skills. Sign up for IBM's > Free Linux Tutorials. Learn everything from the bash shell to sys admin. > Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > |