当前位置: 代码迷 >> Java Web开发 >> spring 配置有关问题
  详细解决方案

spring 配置有关问题

热度:7127   发布时间:2013-02-25 21:20:45.0
spring 配置问题
<bean id="tawRmCommonfaultDetailMgr" parent="txProxyTemplate">
<property name="target">
<bean
class="com.boco.eoms.duty.mgr.impl.TawRmCommonfaultDetailMgrImpl>
<property name="tawRmCommonfaultDetailDao" ref="tawRmCommonfaultDetailDao" />
</bean>
</property>
</bean>
 
  <bean id="tawRmCommonfaultDetailDao" class="com.boco.eoms.duty.dao.jdbc.TawRmCommonfaultDetailDaoJDBC" autowire="byName"/> 这个就是配置
 在java中有tawRmCommonfaultDetailDao的get和set方法。但是出现如下错误
 Error creating bean with name 'tawRmCommonfaultDetailMgr' defined in 
  class path resource [config/applicationContext-duty.xml]: 
  Cannot create inner bean 'com.boco.eoms.duty.mgr.impl.TawRmCommonfaultDetailMgrImpl#fd1463' 
  while setting bean property 'target'; 
  nested exception is org.springframework.beans.factory.BeanCreationException:
  Error creating bean with name 'com.boco.eoms.duty.mgr.impl.TawRmCommonfaultDetailMgrImpl#fd1463' 
  defined in class path resource [config/applicationContext-duty.xml]:
  Cannot resolve reference to bean 'tawRmCommonfaultDetailDao' 
  while setting bean property 'tawRmCommonfaultDetailDao'; 
  nested exception is org.springframework.beans.factory.BeanCreationException
  Error creating bean with name 'tawRmCommonfaultDetailDao' 
  defined in class path resource [config/applicationContext-duty.xml]: 
  Error setting property values; nested exception is PropertyAccessExceptionsException (1 errors)
org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'com.boco.eoms.duty.mgr.impl.TawRmCommonfaultDetailMgrImpl' defined in class path resource [config/applicationContext-duty.xml]: Cannot resolve reference to bean 'tawRmCommonfaultDetailDao' while setting bean property 'tawRmCommonfaultDetailDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tawRmCommonfaultDetailDao' defined in class path resource [config/applicationContext-duty.xml]: Error setting property values; nested exception is PropertyAccessExceptionsException (1 errors)
org.springframework.beans.factory.BeanCreationException
Error creating bean with name 'tawRmCommonfaultDetailDao' 
defined in class path resource [config/applicationContext-duty.xml]: 
Error setting property values; nested exception is PropertyAccessExceptionsException (1 errors)
PropertyAccessExceptionsException (1 errors)
org.springframework.beans.TypeMismatchException
Failed to convert property value of type [org.logicalcobwebs.proxool.ProxoolDataSource] 
to required type [com.boco.eoms.db.util.ConnectionPool] for property 'dataSource'

------解决方案--------------------------------------------------------
Java code
[code=XML]<bean id="tawRmCommonfaultDetailMgr" parent="txProxyTemplate"><property name="target"></property></bean><bean class="com.boco.eoms.duty.mgr.impl.TawRmCommonfaultDetailMgrImpl><property name="tawRmCommonfaultDetailDao" ref="tawRmCommonfaultDetailDao" />    </bean>
------解决方案--------------------------------------------------------
XML code
<bean id="tawRmCommonfaultDetailMgr" parent="txProxyTemplate"><property name="target" 这里没有指明那个ref啊/></bean><bean class="com.boco.eoms.duty.mgr.impl.TawRmCommonfaultDetailMgrImpl><property name="tawRmCommonfaultDetailDao" ref="tawRmCommonfaultDetailDao" />    </bean>
  相关解决方案