用JPA在测试的时候无法创建EntityManager Factory无法创建的几个可能因素!
生活随笔
收集整理的這篇文章主要介紹了
用JPA在测试的时候无法创建EntityManager Factory无法创建的几个可能因素!
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
?
1.路徑 path因素
?
Inherit project compile output path :繼承項(xiàng)目輸出路徑
Use module?compile output path? :使用模塊編譯輸出路徑。如果是選擇繼承項(xiàng)目輸出路徑是可能會導(dǎo)致無法創(chuàng)建entity manager? Factory? 的因素之一!
2.注解關(guān)系錯誤可能也導(dǎo)致無法創(chuàng)建
?
關(guān)系與自己數(shù)據(jù)庫中的表不對應(yīng),也可能是原因之一。大家可以注意一下
3.數(shù)據(jù)庫的驅(qū)動與hibernate的配置方言沒有加載成功,也可能是導(dǎo)致無法創(chuàng)建的因素之一
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" /> <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"></property>
<property name="hibernate.connection.url" value="jdbc:mysql:///jpa?characterEncoding=UTF-8"></property>
<property name="hibernate.connection.username" value="root"></property>
<property name="hibernate.connection.password" value="root"></property>
-------------------------------------------------------------------------------------------------------------
以上就是可能會導(dǎo)致entity manager Factory 無法創(chuàng)建的因素!!!!
?
轉(zhuǎn)載于:https://www.cnblogs.com/DarryZz04/p/11049611.html
總結(jié)
以上是生活随笔為你收集整理的用JPA在测试的时候无法创建EntityManager Factory无法创建的几个可能因素!的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 绝了!这款工具让 Spring Boot
- 下一篇: 程序员捅了个P0故障,公司股价反而涨了1