|
From: Colin S. <col...@ex...> - 2004-11-18 14:08:41
|
This is not really a backwards incompatibility issue, but a config issue. The user was never setting the target in the proxy template (fine, since it's a template), but was not ensuring it was either lazy-load=true or abstract=true to stop it from being instantiated. So when Spring tried to pre-instantiate the template like any other singleton bean, the bean threw an exception as the target was not there. What I don't understand though is why the user never had an issue with this in 1.1.1. It should have behaved exactly the same... Alef Arendsen wrote: > A user on the forum > (http://forum.springframework.org/viewtopic.php?t=2034&start=0&postdays=0&postorder=asc&highlight > <http://forum.springframework.org/viewtopic.php?t=2034&start=0&postdays=0&postorder=asc&highlight>=) > noticed a backward compatibility issue. I'm posting it here as well > and have already replied on the forum. > > It might be wise to include a known-poblems section on the website > somewhere. They are minor issues, but still I think it's good to let > people know if there is any issues. > > regards, > > Alef > > > > =========== > > I had a txProxyTemplate bean defined in my applicationContext > configuration without the abstract="true" attribute and things ran > fine with Spring 1.1.1. I upgraded to Spring 1.1.2 and get an > IllegalArgumentException stating that the template bean *must* have > the abstract="true" attribute if it does not declare a 'target' property. > > I went ahead and added it and it was not a big deal. I'm not saying > that the IllegalArgumentException thrown under this circumstance is > bad, but given the prior behavior, it would have been nicer if it > simply logged a warning since the new behavior does break backward > compatibility. > > > Sanjiv > > -------------------------------------------- > > > org.springframework.beans.factory.BeanCreationException: Error > creating bean with name 'txProxyTemplate' defined in ServletContext > resource [/WEB-INF/applicationContext.xml]: Initialization of bean > failed; nested exception is java.lang.IllegalArgumentException: > 'target' is required > java.lang.IllegalArgumentException: 'target' is required > at > org.springframework.transaction.interceptor.TransactionProxyFactoryBean.afterPropertiesSet(TransactionProxyFactoryBean.java:194) > > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:990) > > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:275) > > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:193) > > at > org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:240) > > at > org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:163) > > at > org.springframework.beans.factory.support.AbstractBeanFactory.getType(AbstractBeanFactory.java:345) > > at > org.springframework.beans.factory.support.DefaultListableBeanFactory.isBeanTypeMatch(DefaultListableBeanFactory.java:193) > > at > org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:157) > > at > org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:526) > > at > net.sf.acegisecurity.util.FilterToBeanProxy.doInit(FilterToBeanProxy.java:170) > > at > net.sf.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:102 > |