|
From: Colin S. <col...@ex...> - 2003-12-12 12:11:23
|
Sure. I think I wasn't that clear maybe, but I meant that in the future we shouldn't try to use this strategy to handle cglib1 vs. cglib2 implementations of stuff. However, with Chris releasing the new cglib 1.1, it looks like we can move to cglib2 everywhere we need it anyways, and people who need 1.1 for Hibernate 2.0 can still use that, so it's moot. jürgen höller [werk3AT] wrote: >I'd like to keep sticking to the inner-class strategy for AdvisedSupport: It removes a CGLIB dependency for people that just want to proxy interfaces anyway. For that use case, no version of CGLIB should have to be in the class path - spring, commons-logging, and aop-alliance should be enough. The actual AopProxy implementations for CGLIB can still use any CGLIB feature that they want. > >Juergen > > >-----Original Message----- >From: spr...@li... >[mailto:spr...@li...]On Behalf >Of Colin Sampaleanu >Sent: Thursday, December 11, 2003 7:42 PM >To: spr...@li... >Subject: Re: [Springframework-developer] RE: About CGLIB2 > > >This works fine now without the cglib1 jar. > >I agree with using the inner-class strategy for a while. We should >probably limit the period of time we do this though; there are a lot of >useful features in cglib2, and it doesn't make sense to ignore them or >have to jump through hoops to use them, for too long a period of time, >considering the only real beneficiaries will be Hibernate 2.0 users, who >are going to be a rapidly dying breed. > >Regards, > > >jürgen höller [werk3AT] wrote: > > > >>I've just fixed it by re-introducing an inner class CglibProxyFactory: Grab the current AdvisedSupport from CVS, and a JDK proxy will work with Hibernate 2.1 - without the need for cglib1.jar in the class path. I've tested it with Petclinic, and it works nicely. >> >>We should stick to that inner-class strategy when migrating to CGLIB2, to let people use Hibernate 2.0.x or iBATIS Database Layer (with CGLIB1 underneath). >> >>Juergen >> >> >>-----Original Message----- >>From: spr...@li... >>[mailto:spr...@li...]On Behalf >>Of Rod Johnson >>Sent: Thursday, December 11, 2003 6:42 PM >>To: spr...@li... >>Subject: Re: [Springframework-developer] RE: About CGLIB2 >> >> >>I guess in my refactoring I lost the indirection by which a CGLIB proxy was >>created only by an inner class, to prevent dependence on CGLIB at runtime. >>I'll try to sort that out tomorrow or Monday. >> >>Btw, the TransactionProxyFactoryBean now extends the new ProxyConfig, which >>has a proxyTargetClass property that defaults to false. Set it to true to >>force CGLIB. Otherwise it won't use CGLIB by default. >> >>Regards, >>Rod >> >>----- Original Message ----- >>From: "Colin Sampaleanu" <col...@ex...> >>To: <spr...@li...> >>Sent: Thursday, December 11, 2003 5:29 PM >>Subject: Re: [Springframework-developer] RE: About CGLIB2 >> >> >> >> >> >> >>>jürgen höller [werk3AT] wrote: >>> >>> >>> >>> >>> >>>>Everybody, >>>> >>>>Hibernate 2.1 final with CGLIB2 underneath has just been released. This >>>> >>>> >>>> >>>> >>poses the question whether we should still release our 1.0 M4 with CGLIB1 >>support. Of course, our current codebase works nicely with Hibernate 2.1 as >>long as you don't use CGLIB-based AOP proxies (i.e. proxy full target >>objects instead of just interfaces), so we don't *have* to update >>immediately. >> >> >> >> >>>> >>>> >>>> >>>> >>>Hmm, maybe this was once the case, but I am not sure it is so easy any >>>longer. I tried dropping in Hibernate 2.1 final (with cglib2). However, >>>when using TransactionProxyFactoryBean, which no longer has the old >>>ProxyInterfacesOnly boolean option (which used to default to true, and >>>used a JDK proxy in the true case instead of cglib proxy), I now get an >>>exception >>> >>>java.lang.NoClassDefFoundError: >>>org/springframework/aop/framework/OptimizedCglib1AopProxy >>> at >>> >>> >>> >>> >>> >>org.springframework.transaction.interceptor.TransactionProxyFactoryBean.afte >>rPropertiesSet(TransactionProxyFactoryBean.java:167) >> >> >> >> >>> at >>> >>> >>> >>> >>> >>org.springframework.beans.factory.support.AbstractBeanFactory.callLifecycleM >>ethodsIfNecessary(AbstractBeanFactory.java:1011) >> >> >> >> >>> at >>> >>> >>> >>> >>> >>org.springframework.beans.factory.support.AbstractBeanFactory.createBean(Abs >>tractBeanFactory.java:539) >> >> >> >> >>> at >>> >>> >>> >>> >>> >>org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstra >>ctBeanFactory.java:186) >> >> >> >> >>> at >>> >>> >>> >>> >>> >>org.springframework.beans.factory.support.DefaultListableBeanFactory.preInst >>antiateSingletons(DefaultListableBeanFactory.java:184) >> >> >> >> >>> at >>> >>> >>> >>> >>> >>org.springframework.context.support.AbstractApplicationContext.refresh(Abstr >>actApplicationContext.java:284) >> >> >> >> >>> at >>> >>> >>> >>> >>> >>org.springframework.web.context.support.XmlWebApplicationContext.refresh(Xml >>WebApplicationContext.java:107) >> >> >> >> >>>The offending line is: >>> >>> ProxyFactory proxyFactory = new ProxyFactory(); >>> >>>Of course, ProxyFactory extends AdvisedSupport, which directly >>>references OptimizedCglib1AopProxy. >>> >>> >>> >>> > > > > >------------------------------------------------------- >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 > > >------------------------------------------------------- >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_id78&alloc_id371&op=click >_______________________________________________ >Springframework-developer mailing list >Spr...@li... >https://lists.sourceforge.net/lists/listinfo/springframework-developer > > |