<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆 - 6  文章 - 129  trackbacks - 0
    <2025年5月>
    27282930123
    45678910
    11121314151617
    18192021222324
    25262728293031
    1234567

    常用鏈接

    留言簿(14)

    隨筆檔案(6)

    文章分類(467)

    文章檔案(423)

    相冊

    收藏夾(18)

    JAVA

    搜索

    •  

    積分與排名

    • 積分 - 825594
    • 排名 - 49

    最新評論

    閱讀排行榜

    評論排行榜

    一個關(guān)于struts + spring + hibernate整合事務(wù)配置的問題(請教高手)
    ... ...
    <?xml version="1.0" encoding="UTF-8"?>
    <beans
     xmlns="http://www.springframework.org/schema/beans"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

     <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
      <property name="sessionFactory" ref="sessionFactory"></property>
     </bean>
     
     <bean id="txProxyTemplate" abstract="true"
        class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
      <property name="transactionManager" ref="transactionManager"></property>
      <property name="transactionAttributes">
       <props>
        <prop key="create*">PROPAGATION_REQUIRED</prop>
        <prop key="update*">PROPAGATION_REQUIRED</prop>
        <prop key="delete*">PROPAGATION_REQUIRED</prop>
        <prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
       </props>
      </property>
     </bean>
     
     <bean id="userDAO" class="dgut.ke.dao.impl.UserDAO">
          <property name="sessionFactory" ref="sessionFactory"></property>
     </bean>
    <bean id="userService"  parent="txProxyTemplate"  class="dgut.ke.service.impl.UserService">
        <property name="userDAO" ref="userDAO" />
    </bean>
    ... ....
    啟動Tomecat時出了錯.之前沒有添加事務(wù)處理時.上面的代碼是可以正常運行的.添加事務(wù)之后卻出現(xiàn)以下錯誤
    ERROR - Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService' defined in ServletContext resource [/WEB-INF/applicationContext-hibernate.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'transactionManager' of bean class [dgut.ke.service.impl.UserService]: Bean property 'transactionManager' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
    Caused by:
    org.springframework.beans.NotWritablePropertyException: Invalid property 'transactionManager' of bean class [dgut.ke.service.impl.UserService]: Bean property 'transactionManager' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
    解決辦法

    <bean id="userService"  parent="txProxyTemplate"  class="dgut.ke.service.impl.UserService">
        <property name="userDAO" ref="userDAO" />
    </bean>
    換成以下代碼就可以正常運行了
     <bean id="userService" parent="txProxyTemplate">
          <property name="target">
               <bean class="dgut.ke.service.impl.UserService">
                    <property name="userDAO" ref="userDAO"></property>
               </bean>
          </property>
     </bean>

    請教一下為什么會出現(xiàn)這種情況?
    哪位高手解釋下,謝謝!!!

    posted on 2007-10-07 13:36 Ke 閱讀(2783) 評論(1)  編輯  收藏 所屬分類: exception 、問題區(qū)

    FeedBack:
    # re: struts + spring + hibernate整合事務(wù)配置的問題(請教高手)[未登錄] 2007-11-30 09:03 hehe
    一樣的問題,在此找到答案,謝了
    曾試著這樣
    <bean id="userService" parent="txProxyTemplate">
    <property name="target">
    <bean class="dgut.ke.service.impl.UserService">
    </bean>
    </property>
    </bean>
    就是沒想到要把DAO作為屬性加進(jìn)去
      回復(fù)  更多評論
      
    主站蜘蛛池模板: 亚洲一区AV无码少妇电影☆| 亚洲日韩精品无码专区加勒比 | 亚洲视频免费在线看| 国产美女无遮挡免费视频| 亚洲免费精彩视频在线观看| 国产亚洲午夜精品| 亚洲啪啪免费视频| 亚洲国产精华液网站w| 免费又黄又爽又猛的毛片| 最近免费中文字幕4| 24小时日本电影免费看| a级片免费在线播放| 特级毛片aaaa免费观看| 亚洲欧洲无码一区二区三区| 亚洲中文字幕一区精品自拍| 亚洲精品第五页中文字幕| 久久久久久久综合日本亚洲| 亚洲AV日韩精品久久久久| 亚洲熟妇av一区二区三区漫画| 亚洲热线99精品视频| 亚洲成年轻人电影网站www| 亚洲电影免费观看| 亚洲乱码中文字幕在线| 日韩免费在线中文字幕| 成人久久免费网站| a级成人免费毛片完整版| 99在线热视频只有精品免费| 97人妻精品全国免费视频| 18观看免费永久视频| 成人av免费电影| 在线观看免费a∨网站| 免费国产成人午夜私人影视 | 国产成人免费高清激情明星| 久久成人免费电影| 日本黄色动图免费在线观看| 免费在线看v网址| 成人AV免费网址在线观看| 免费精品国产自产拍在| 亚洲AⅤ视频一区二区三区| 免费人成激情视频| 亚洲AV无码码潮喷在线观看|