日期:2014-05-18  浏览次数:20785 次

hibernate+sping 配置文件的问题(分不够再加)
在调试的时候,出现如下提示:

org.springframework.beans.factory.BeanCreationException:   Error   creating   bean   with   name   'userService '   defined   in   ServletContext   resource   [/WEB-INF/applicationContext.xml]:  

Can 't   resolve   reference   to   bean   'userTarget '   while   setting   property   'target ';   nested   exception   is   org.springframework.beans.factory.BeanCreationException:   Error   creating   bean   with   name   'userTarget '   defined   in   ServletContext   resource   [/WEB-INF/applicationContext.xml]:  

Error   setting   property   values;   nested   exception   is   org.springframework.beans.NotWritablePropertyException:   Invalid   property   'iUser '   of   bean   class   [com.bookstore.spring.service.UserServiceImpl]:  

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

------------------------------
applicationContext.xml
------------------------------------

    <!--   *****   USER   SERVICE   *****-->
    <bean   id= "userService "   class= "org.springframework.transaction.interceptor.TransactionProxyFactoryBean ">
        <property   name= "transactionManager ">
            <ref   local= "myTransactionManager "/>
        </property>
        <property   name= "target ">
            <ref   local= "userTarget "/>
        </property>
        <property   name= "transactionAttributes ">
            <props>
                <prop   key= "find* "> </prop>
                <prop   key= "save* "> </prop>
            </props>
        </property>
    </bean>
    <!--   *************************************************************************************   -->
    <!--   userTarget   primary   business   object   implementation   -->
    <bean   id= "userTarget "   class= "com.bookstore.spring.service.UserServiceImpl ">
        <property   name= "iUser ">
            <ref   local= "userDao "/>
        </property>