我在config.xml中..
<bean id="helloController" class="net.ali.web.HelloController">
<property name="viewName">
<value>hello</value>
</property>
<property name="userDao">
<ref bean="userDAOProxy" /> <!-- 注入一个bean(定义在Hibernate的配置文件里) -->
</property>
</bean>
注入一个叫userDAOProxy的bean..该bean在applicationContext.xml中定义的..如下
<bean id="userDAOProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref bean="transactionManager" />
</property>
<property name="target">
<ref local="userDao" />
</property>
<property name="transactionAttributes">
<props>
<prop key="insert*">PROPAGATION_REQUIRED</prop>
<prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
</props>
</property>
</bean>
可是报Cannot resolve reference to bean 'userDAOProxy' while setting bean property 'userDao'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'userDAOProxy' is defined找不到bean错误..
各位大虾帮帮忙..
<bean id="helloController" class="net.ali.web.HelloController">
<property name="viewName">
<value>hello</value>
</property>
<property name="userDao">
<ref bean="userDAOProxy" /> <!-- 注入一个bean(定义在Hibernate的配置文件里) -->
</property>
</bean>
注入一个叫userDAOProxy的bean..该bean在applicationContext.xml中定义的..如下
<bean id="userDAOProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref bean="transactionManager" />
</property>
<property name="target">
<ref local="userDao" />
</property>
<property name="transactionAttributes">
<props>
<prop key="insert*">PROPAGATION_REQUIRED</prop>
<prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
</props>
</property>
</bean>
可是报Cannot resolve reference to bean 'userDAOProxy' while setting bean property 'userDao'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'userDAOProxy' is defined找不到bean错误..
各位大虾帮帮忙..
解决方案 »
- j2ee程序在weblogic8.1上跑,如何监控java GC
- spring事务的问题 并发时,事务不生效!
- httpclient post问题
- spring+activemq 配置文件 怎么写(点对点 订阅发布)
- freemarker 如何扩展自己的标签
- java中的维度
- The method getJspApplicationContext(ServletContext) is undefined for the type
- j2ee with ejb是不是很难啊
- 高分请人帮忙
- 新人手问:请问现在公司做J2EE项目时用EJB做实体层还是Hibernate
- 谁给解释一下struts2 stream 导出的问题
- 在线请教,Java调用wsdl报错
<import resource="xxxx.xml"/> 把相应的文件引入
我分数不多,全给你们了..不要嫌少咯..