现在的位置: 首页 > 综合 > 正文

启动tomcat 时的applicationContext.xml异常

2013年10月18日 ⁄ 综合 ⁄ 共 996字 ⁄ 字号 评论关闭

启动tomcat的时候spring的配置文件报出异常,

我的配置文件是这样定义的,我应用了dao模式,如: 

    <bean id="okManager" class="com.mytest.OkManagerImpl"  autowire="byName">
         <property name="youAreOKDAO">
           <ref local="youAreOKDAO"/>
         </property>
    </bean>

 <bean id="youAreOKDAO" parent="baseTxProxy">
    <property name="target">
      <bean class="com.test.dao.YouAreOKDAOImpl" autowire="byName">
    <property name="cacheQueries">
     <value>true</value>
    </property>        
      </bean>
    </property>
 </bean>

运行的时候报异常为

Error creating bean with name 'okManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]:

 Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'youAreOKDAO' of bean class [com.caicai.lead21.service.spring.NewsContentServiceSpringImpl]:

 Bean property 'youAreOKDAO' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?

在YouAreOKDAOImpl里我已经写了相应的set和get方法,可是就是报错,后来我把dao的名字改成了youareokDAO都是小写,重新部署,之后就不报错了

【上篇】
【下篇】

抱歉!评论已关闭.