Error registering bean with name 'baseTransactionProxy' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: <property> element for property 'transactionAttributes' must specify a ref or value
根据这句提示看,应该是在配置'baseTransactionProxy' bean 时出了问题了。配置文件贴来看看才是
根据这句提示看,应该是在配置'baseTransactionProxy' bean 时出了问题了。配置文件贴来看看才是
<beans>
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<value>WEB-INF/jdbc.properties</value>
</property>
</bean>
<!-- ========================= 定义表单验证 ========================= -->
<bean id="accountValidator"
class="org.springframework.samples.jpetstore.domain.logic.AccountValidator">
</bean>
<!-- ========================= 为业务逻辑层提供事务管理========================= --> <bean id="baseTransactionProxy"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"
abstract="true">
<property name="transactionManager" ref="transactionManager"></property>
<property name="transactionAttributes"></property>
<property name="transactionAttributes">
<props>
<prop key="insert*">PROPAGATION_REQUIRED</prop>
<prop key="update*">PROPAGATION_REQUIRED</prop>
<prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
</props>
</property>
</bean>
<bean id="petStore" parent="baseTransactionProxy">
<property name="target">
<bean
class="org.springframework.samples.jpetstore.domain.logic.PetStoreImpl">
<property name="accountDao" ref=" accountDao"></property>
<property name="productDao" ref="productDao"></property> </bean>
</property>
</bean>
</beans>
那位高手赶紧看一下,啊,,急死了。
<property name="transactionAttributes">
这里是怎么回事?是不是多写了一点呀?你再看看.是不是因为多谢了上边那句引起的。
大概应该是在applicationcontext.xml中配置一下
<property name="transactionAttributes"> </property>
<property name="transactionAttributes">
<props>
<prop key="insert*">PROPAGATION_REQUIRED </prop>
<prop key="update*">PROPAGATION_REQUIRED </prop>
<prop key="*">PROPAGATION_REQUIRED,readOnly </prop>
</props>
</property>
明显的多谢了一个:<property name="transactionAttributes"> </property>就是这个没有赋值的同名属性导致了出错,你把它删掉就好了