|
From: Colin S. <col...@ex...> - 2003-12-11 18:42:07
|
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. >> >> |