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

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

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

    在使用Spring相關產品時,你可能會碰到下面這種異常:
    Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
    這是異常的第一行,按以往的經驗,第一行應該就是問題所在,但是實際上,從這行來看你根本不知道錯在哪里。

    后面接下來的是:
    Error creating bean with name 'basicProcessingFilter'
    Cannot resolve reference to bean 'authenticationManager'
    while setting bean property 'authenticationManager';

    nested exception is Error creating bean with name 'authenticationManager'
    Cannot resolve reference to bean 'casAuthenticationProvider'
    while setting bean property 'providers' with key [0];

    nested exception is : Error creating bean with name 'casAuthenticationProvider'
    Cannot resolve reference to bean 'statelessTicketCache'
    while setting bean property 'statelessTicketCache';

    nested exception is: Error creating bean with name 'statelessTicketCache'
    Error setting property values;

    nested exception is
    nested PropertyAccessExceptions (1) are:
    PropertyAccessException 1:
    TypeMismatchException:

    Failed to convert property value of type [net.sf.ehcache.Cache]
    to required type [net.sf.ehcache.Ehcache] for property 'cache'

    Error creating bean with name 'authenticationManager'
    Cannot resolve reference to bean 'casAuthenticationProvider'
    while setting bean property 'providers' with key [0];

    nested exception is
    Error creating bean with name 'casAuthenticationProvider'
    Cannot resolve reference to bean 'statelessTicketCache' while setting bean property 'statelessTicketCache';

    nested exception is
    Error creating bean with name 'statelessTicketCache'
    Error setting property values;

    nested exception is
    nested PropertyAccessExceptions (1) are:
    PropertyAccessException 1: org.springframework.beans.TypeMismatchException:
    Failed to convert property value of type [net.sf.ehcache.Cache]
    to required type [net.sf.ehcache.Ehcache] for property 'cache'

    Error creating bean with name 'casAuthenticationProvider'
    Cannot resolve reference to bean 'statelessTicketCache'
    while setting bean property 'statelessTicketCache';

    nested exception is
    Error creating bean with name 'statelessTicketCache'
    Error setting property values;

    nested exception is PropertyAccessExceptionsException;
    nested PropertyAccessExceptions (1) are:
    PropertyAccessException 1:TypeMismatchException:
    Failed to convert property value of type [net.sf.ehcache.Cache]
    to required type [net.sf.ehcache.Ehcache] for property 'cache'

    Error creating bean with name 'statelessTicketCache'
    Error setting property values;

    nested exception is PropertyAccessExceptionsException;
    nested PropertyAccessExceptions (1) are:
    PropertyAccessException 1: org.springframework.beans.TypeMismatchException:
    Failed to convert property value of type [net.sf.ehcache.Cache]
    to required type [net.sf.ehcache.Ehcache] for property 'cache'

    PropertyAccessExceptionsException;
    nested PropertyAccessException details (1) are:
    PropertyAccessException 1:
    ypeMismatchException:
    Failed to convert property value of type [net.sf.ehcache.Cache]
    to required type [net.sf.ehcache.Ehcache] for property 'cache'

    上面的內容是我將重復信息去掉,并分塊后的結果。

    從報錯機制可以看出來,spring出現異常不同于普通的java異常,我們查異常的習慣一般是關注第一行,但是sping恰恰相反,要在sping中查錯,你必須分解他,因為spring的嵌套層次比較多,它報錯是從最高層報起,然后逐層往下,每個層次都會要報錯,直到最終出錯的地方,因此查sping的錯必須逐層分解到最底層,那里才是真正出錯的地方。

    OK,現在看出來了,真正錯誤的原因是:
    Failed to convert property value of type [net.sf.ehcache.Cache]
    to required type [net.sf.ehcache.Ehcache] for property 'cache'

    我出現這個錯誤的原因是使用了Acegi 1.0.5,它本身自帶了ehcache 1.2.4.jar
    但是我同時還使用了hibernate3.1,從Eclipse導入hibernate3.1時,將會導入ehcache 1.1.jar,因為hibernate本身也要使用EHCache,但是版本不同。


    只有注冊用戶登錄后才能發表評論。


    網站導航:
     

    posts - 3, comments - 32, trackbacks - 0, articles - 3

    Copyright © Exiler

    主站蜘蛛池模板: 久久99国产亚洲高清观看首页 | 日韩一级视频免费观看| 亚洲AV无码专区在线观看成人| 国产jizzjizz免费视频| 国产99久久久久久免费看| 精品日韩亚洲AV无码| 特级淫片国产免费高清视频| 中国在线观看免费的www| 亚洲一级毛片在线播放| 国产福利电影一区二区三区,亚洲国模精品一区 | 亚洲色欲色欲www在线播放| 亚洲人成人网站在线观看| **aaaaa毛片免费| 色多多www视频在线观看免费| 91亚洲国产成人久久精品网站| 在线永久免费观看黄网站| 久久中文字幕免费视频| 国产亚洲美女精品久久久久| 亚洲天天做日日做天天欢毛片 | 亚洲专区在线视频| 国产伦精品一区二区三区免费迷 | 亚洲欧美自偷自拍另类视| 亚洲精品卡2卡3卡4卡5卡区| 成年女人免费v片| 一级毛片在线免费观看| 一边摸一边爽一边叫床免费视频| 亚洲精品伊人久久久久| 亚洲AV永久无码精品成人| 免费乱码中文字幕网站| 无码专区永久免费AV网站| 免费观看91视频| 在线播放免费人成视频网站 | 国产1000部成人免费视频| 国产一级a毛一级a看免费人娇 | 无码中文字幕av免费放dvd| 在线播放免费人成视频网站| 色欲色欲天天天www亚洲伊| 亚洲短视频在线观看| 亚洲AV无码专区电影在线观看| 亚洲av再在线观看| 国产精品久久久久影院免费|