org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactoryId' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Initialization of bean failed; nested exception is org.hibernate.cache.CacheException: net.sf.ehcache.CacheException: Cannot configure CacheManager: 文件過早結束。

昨天rebase后出現了這個問題,費了我一個下午的時間,多方查找資料都沒有辦法,到今天早上后看到
http://forum.springframework.org/showthread.php?t=25528上說的。才知道大概是ehcache配制不當造成的,于是從同事那里拷貝ehcache.xml過來,解決了!血的教訓!

ehcache是一個很不錯的輕量級緩存實現,速度快,功能全面(一般的應用完全足夠了),從1.2版后可以支持分布式緩存,可以用在集群環境中。除了可以緩存普通的對象,還可以用來作為Web頁面的緩存。緩存靜態HTML、JSP、Velocity、FreeMarker等等的頁面。Hibernate選擇ehcache作為默認的緩存實現的。