2012-02-03 138 views

回答

6
<property name="configLocation" value="classpath:hibernate.cfg.xml" /> 
+0

我將此屬性添加到applicationContext.xml中的bean定義(sessionFactory)中。它看起來仍然不能從hibernate.cfg.xml中獲取配置。實際上,我在'hibernate.cfg.xml'中爲'NoCacheProvider'指定了'ClassNotFoundException:org.hibernate.cache.CacheProvider'。 – 2012-02-06 13:16:34

+0

我正在使用'org.springframework.orm.hibernate3.LocalSessionFactoryBean'。在類名中更改爲'hibernate4'而不是hibernate3時。它工作(而不是轉移到另一個錯誤)。 – 2012-02-07 14:22:52

相關問題