无法配置EntityManagerFactory - Hibernate Mockito

时间:2015-10-04 12:59:37

标签: hibernate jpa mockito

当我在mockito测试中运行我的代码时,我遇到了这个错误 我的权力模拟忽略是:

    @PowerMockIgnore({"javax.management.*", "ch.qos.logback.*", "org.slf4j.*", "javax.persistence.*", "org.w3c.*", "javax.net.ssl.*","javax.xml.parsers.*", "com.sun.org.apache.xerces.internal.*.*"})

Caused by: javax.persistence.PersistenceException: javax.persistence.PersistenceException: Unable to configure EntityManagerFactory
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:385)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:56)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63)
at com.hasintech.authorizerportal.database.DbHelper.initFactory(DbHelper.java:63)
at com.hasintech.authorizerportal.database.DbHelper.<clinit>(DbHelper.java:27)
... 34 more
Caused by: java.lang.IllegalArgumentException: No SchemaFactory that implements the schema language specified by: http://www.w3.org/2001/XMLSchema could be loaded
at javax.xml.validation.SchemaFactory.newInstance(SchemaFactory.java:204)
at org.hibernate.ejb.packaging.PersistenceXmlLoader.loadURL(PersistenceXmlLoader.java:91)
at org.hibernate.ejb.packaging.PersistenceXmlLoader.deploy(PersistenceXmlLoader.java:171)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:324)
... 38 more

1 个答案:

答案 0 :(得分:-1)

添加&#34; org.hibernate。*&#34;权力模拟忽略:

CURLOPT_COOKIEFILE