I would like to have default aop setting for all my beans, putting the properties in only one place, like this:
But I get an error saying '"org.springframework.beans.FatalBeanException: Class [org.springframework.beans.factory.FactoryBean] cannot be instantiated: it is an interface.'Code:<bean id="baseProxy" abstract="true" class="org.springframework.beans.factory.FactoryBean"> <property name="frozen"><value>${spring.aop.advice.frozen}</value></property> <property name="optimize"><value>${spring.aop.doCGLibProxies}</value></property> <property name="opaque"><value>${spring.aop.opaqueProxies}</value></property> </bean> <bean id="baseTransactionProxy" abstract="true" parent="baseProxy"> <property name="transactionManager"><ref bean="transactionManager"/></property> </bean> <bean id="baseNonTransactionalProxy" abstract="true" parent="baseProxy"> <!--Include some properties that are specific to beans that do not themselves control transactions. --> </bean>
So I have to settle for putting the properties in two places, like this:
Is there some way I can put those properties in just one place?Code:<bean id="baseTransactionProxy" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> <property name="transactionManager"><ref bean="transactionManager"/></property> <property name="frozen"><value>${spring.aop.advice.frozen}</value></property> <property name="optimize"><value>${spring.aop.doCGLibProxies}</value></property> <property name="opaque"><value>${spring.aop.opaqueProxies}</value></property> </bean> <bean id="baseNonTransactionalProxy" abstract="true" class="org.springframework.aop.framework.ProxyFactoryBean"> <property name="frozen"><value>${spring.aop.advice.frozen}</value></property> <property name="optimize"><value>${spring.aop.doCGLibProxies}</value></property> <property name="opaque"><value>${spring.aop.opaqueProxies}</value></property> </bean>


Reply With Quote