posts - 40,  comments - 187,  trackbacks - 0

          問題:
          llegalAccessError: tried to access method net.sf.ehcache.CacheManager. ()V from class org.hibernate.cache.EhCacheProvider Caused by: java.lang.IllegalAccessError: tried to access method net.sf.ehcache.CacheManager.

          原因:
          由于ehcache的一個bug導致的結果

          解決方法:
          需要把ehcache升級到1.2以上的版本

          posted on 2007-03-20 09:58 小立飛刀 閱讀(2699) 評論(8)  編輯  收藏 所屬分類: Hibernate

          FeedBack:
          # re: Hibernate3.2中Ehcache的llegalAccessError
          2007-03-20 10:09 | aninggo
          1.24也有bug 和spring結合的時候,如果進行單元測試的話 會出現一個 shutdown hooks 的錯誤..愁死我了 好象現在的1.30beat 出來了 不知道休整了沒.  回復  更多評論
            
          # re: Hibernate3.2中Ehcache的llegalAccessError
          2007-03-20 10:17 | 小雪飛刀
          @aninggo
          您的Spring是什么版本的?我還真沒遇到您說的問題,能否具體描述一下:)  回復  更多評論
            
          # re: Hibernate3.2中Ehcache的llegalAccessError
          2007-03-20 15:12 | aninggo
          版本 是 spring2.0.3 ehcache1.2.4
          目前只在 但愿測試的時候 碰到過 也就是 單元測試結束 銷毀方法的時候 掉用 CacheManager.removeShutdownHook 時候 錯顯得錯誤。 還沒有 搞清楚 是 為什么。去 看了他的 maillist發現 appfuse的作者 mat也 發現了這個錯誤 。

          java.lang.IllegalStateException: Shutdown in progress
          at java.lang.ApplicationShutdownHooks.remove(ApplicationShutdownHooks.java:55)
          at java.lang.Runtime.removeShutdownHook(Runtime.java:220)
          at net.sf.ehcache.CacheManager.removeShutdownHook(CacheManager.java:524)
          at net.sf.ehcache.CacheManager.shutdown(CacheManager.java:711)
          at org.hibernate.cache.EhCacheProvider.stop(EhCacheProvider.java:158)
          at org.hibernate.impl.SessionFactoryImpl.close(SessionFactoryImpl.java:798)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at org.springframework.orm.hibernate3.AbstractSessionFactoryBean$TransactionAwareInvocationHandler.invoke(AbstractSessionFactoryBean.java:313)
          at $Proxy16.close(Unknown Source)
          at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.destroy(AbstractSessionFactoryBean.java:193)
          at org.springframework.orm.hibernate3.LocalSessionFactoryBean.destroy(LocalSessionFactoryBean.java:854)
          at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:145)
          at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:335)
          at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:308)
          at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:282)
          at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:656)
          at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:634)
          at org.springframework.context.support.AbstractApplicationContext$1.run(AbstractApplicationContext.java:571)  回復  更多評論
            
          # re: Hibernate3.2中Ehcache的llegalAccessError
          2007-03-20 16:05 | 小雪飛刀
          @aninggo
          還沒用過Spring2.0版本,一直在用1.2.8版。寫了Unit Test,在1.2.8版中沒發生這個問題。所以認為有可能是Spring的問題。
            回復  更多評論
            
          # re: Hibernate3.2中Ehcache的llegalAccessError
          2007-03-21 09:32 | aninggo
          已經用oscache替換了ehcache 感覺oscache還是不錯的  回復  更多評論
            
          # re: Hibernate3.2中Ehcache的llegalAccessError
          2007-03-21 09:57 | 小雪飛刀
          @aninggo
          我這里將oscache用在JSP Caching、Request Caching方面,效果很好!  回復  更多評論
            
          # re: Hibernate3.2中Ehcache的llegalAccessError
          2007-06-27 12:13 | 瘋了


          搞了半天,換了個spring.jar好了,好郁悶  回復  更多評論
            
          # re: Hibernate3.2中Ehcache的llegalAccessError
          2007-06-27 13:23 | 小雪飛刀
          @瘋了
          沒錯 跟Spring的版本也有關系
            回復  更多評論
            
          <2007年3月>
          25262728123
          45678910
          11121314151617
          18192021222324
          25262728293031
          1234567

          生存或毀滅,這是個必答之問題:是否應默默的忍受坎苛命運之無情打擊,還是應與深如大海之無涯苦難奮然為敵,并將其克服。此二抉擇,究竟是哪個較崇高?

          常用鏈接

          留言簿(12)

          隨筆分類(43)

          相冊

          收藏夾(7)

          朋友的博客

          電子資料

          搜索

          •  

          積分與排名

          • 積分 - 302763
          • 排名 - 192

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 绥棱县| 陕西省| 鄯善县| 晋江市| 潼关县| 宁河县| 河西区| 北票市| 陈巴尔虎旗| 汨罗市| 乌兰察布市| 行唐县| 惠东县| 霍邱县| 温宿县| 三明市| 绥棱县| 贺州市| 东乌| 霍邱县| 东源县| 乌审旗| 福建省| 杂多县| 永年县| 辉南县| 余江县| 梧州市| 团风县| 江津市| 陕西省| 尼木县| 古丈县| 社旗县| 东安县| 交口县| 玉树县| 盐亭县| 霍山县| 台南市| 大悟县|