問題:
新建web項目時若使用javaee6的情況下其下面的javax.persistence.jar包將對獲得factory進行校驗,即不能得到sessionFactory。報錯:org.hibernate.HibernateException: Unable to get the default Bean Validation Factory
解決方案:
在hibernate的配置文件中加入<property name="javax.persistence.validation.mode">none</property>,即跳過javaee6的校驗。即可