No Persistence provider for EntityManager问题

NetBeans 开发 JPA 应用程序,使用 TopLink ,报如下错误:

 

Exception in thread "main" javax.persistence.PersistenceException: No Persistence provider for EntityManager named XXX:  The following providers:

org.hibernate.ejb.HibernatePersistence

oracle.toplink.essentials.PersistenceProvider

oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider

Returned null to createEntityManagerFactory.

 

换成 Hibernate 就没有这个问题。

 

经网上查找( http://www.netbeans.com.cn/read.php?tid=775 )和测试,这是由于项目带有中文路径的 BUG

你可能感兴趣的:(No Persistence provider for EntityManager问题)