出现异常的原因是在application-xxx.xml中property name的错误。   

  •   
  •   <property name="...."> 中name的名字是与bean的set方法相关的,而且要注意大小写。   
  •   
  •   比如   
  •   
  • public class PostManageImpl extends BaseManage implements PostManage {   
  •  private PostDAO dao = null;   
  •  public void setPostDAO(PostDAO postDAO){   
  •   this.dao = postDAO;   
  •  }   
  • }    
  •   
  •   那么xml的定义应该是:   
  •   
  • <bean id="postManage" parent="txProxyTemplate">   
  • <property name="target">   
  •  <bean class="com.yz.spring.service.implement.PostManageImpl">   
  •   <property name="postDAO"><ref bean="postDAO"/></property> 对   
  •   <property name="dao"><ref bean="postDAO"/></property> 错   
  •  </bean>   
  • </property>   
  • </bean> 

相关文章:

  • 2022-12-23
  • 2021-09-18
  • 2021-12-28
  • 2022-12-23
  • 2021-08-31
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-03-09
  • 2022-12-23
  • 2021-10-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案