首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

spring 配置有关问题

2013-09-11 
spring 配置问题bean idtawRmCommonfaultDetailMgr parenttxProxyTemplateproperty nametarget

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> 


[解决办法]
Cannot create inner bean 'com.boco.eoms.duty.mgr.impl.TawRmCommonfaultDetailMgrImpl#fd1463' 
while setting bean property 'target';


[解决办法]
bean这里写的对应不上

探讨
<bean id="tawRmCommonfaultDetailMgr" parent="txProxyTemplate">
<property name="target">
<bean
class="com.boco.eoms.duty.mgr.impl.TawRmCommonfaultDetailMgrImpl>
<property name="tawRmCommonfaultDeta……

[解决办法]
你把那个先提出来用REF试试 看是哪个
<bean
class="com.boco.eoms.duty.mgr.impl.TawRmCommonfaultDetailMgrImpl>
<property name="tawRmCommonfaultDetailDao" ref="tawRmCommonfaultDetailDao" /> 
</bean>
这个BEAN好像就没成功
[解决办法]
最 nested exception是:
Cannot resolve reference to bean 'tawRmCommonfaultDetailDao'

tawRmCommonfaultDetailDao这个是作为bean来被引用的,spring无法解析是有原因的,也就是说这个bean是要定义的吧?
[解决办法]
探讨
最 nested exception是:
Cannot resolve reference to bean 'tawRmCommonfaultDetailDao'

tawRmCommonfaultDetailDao这个是作为bean来被引用的,spring无法解析是有原因的,也就是说这个bean是要定义的吧?

[解决办法]
tawRmCommonfaultDetailDao 要先初始化的。
[解决办法]
探讨

引用:

引用:
最 nested exception是:
Cannot resolve reference to bean 'tawRmCommonfaultDetailDao'

tawRmCommonfaultDetailDao这个是作为bean来被引用的,spring无法解析是有原因的,也就是说这个bean是要定义的吧?


我也……

[解决办法]
怎么就没人看到最后一句呢
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'

在注入dataSource时类型不匹配。

热点排行