- XML code
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"><beans> <bean id="baseTransactionProxy" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> <property name="transactionManager"> <ref bean="transactionManager" /> </property> <property name="transactionAttributes"> <props> <prop key="delete*">PROPAGATION_REQUIRED</prop> <prop key="saveOrUpdate*">PROPAGATION_REQUIRED</prop> <prop key="save*">PROPAGATION_REQUIRED</prop> <prop key="insert*">PROPAGATION_REQUIRED</prop> <prop key="add*">PROPAGATION_REQUIRED</prop> <prop key="create*">PROPAGATION_REQUIRED</prop> <prop key="update*">PROPAGATION_REQUIRED</prop> <prop key="modify*">PROPAGATION_REQUIRED</prop> <prop key="remove*">PROPAGATION_REQUIRED</prop> <prop key="manual*">PROPAGATION_REQUIRED</prop> <prop key="pub*">PROPAGATION_REQUIRED</prop> <prop key="sub*">PROPAGATION_REQUIRED</prop> <prop key="stop*">PROPAGATION_REQUIRED</prop> <prop key="store*">PROPAGATION_REQUIRED</prop> <prop key="init*">PROPAGATION_REQUIRED</prop> </props> </property> </bean> <bean id="testSvc" parent="baseTransactionProxy" singleton="true"> <property name="target"> <bean class="svc.TestSvc" singleton="true"> <property name="testDao"> <ref bean="testDao" /> </property> </bean> </property> </bean></beans>
web.xml也配置好了
testSvc没有被初始化,我在注入的bean里面,打印testSvc == null,结果为true。哪里配置错了?
控制台没有错误信息。
------解决方案--------------------------------------------------------
你在什么地方打印这个信息呢?得详细描述下,呵呵呵。
------解决方案--------------------------------------------------------
set方法写了没?写正确没有?