`
qj200040
  • 浏览: 38557 次
  • 性别: Icon_minigender_1
  • 来自: 广西
社区版块
存档分类
最新评论

No Persistence provider for EntityManager named …

    博客分类:
  • JPA
阅读更多
I have my persistence.xml with the same name, using toplink, under META-INF directory. Then I have my code calling it with...
EntityManagerFactory factory =Persistence.createEntityManagerFactory("openjpa");

Yet, I got the following error message
2010-08-19 09:22:41,018 [main] ERROR - No Persistence provider for EntityManager named openjpa
javax.persistence.PersistenceException: No Persistence provider for EntityManager named openjpa
    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:89)
    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:60)



Here is the persistence.xml...
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
   version="1.0">
   <persistence-unit name="openjpa" transaction-type="RESOURCE_LOCAL">
   <jta-data-source>java:/DefaultDS</jta-data-source>
      <properties>
         <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect"/>
         <property name="hibernate.hbm2ddl.auto" value="update"/>
         <property name="hibernate.connection.driver_class" value="org.gjt.mm.mysql.Driver"/>
         <property name="hibernate.connection.username" value="root"/>
         <property name="hibernate.connection.password" value=""/>
         <property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/bookshop?useCode=true&amp;characterEncoding=UTF-8"/>
      </properties>
   </persistence-unit>
</persistence>


It should have been in the classpath... Yet, I got the above error... Really appreciate any help... Thanks
分享到:
评论
3 楼 我思故我在 2012-07-03  
Please pay attention to “No Persistence provider for EntityManager”

That means you don‘t hava the persistence provider

Just add the jar “hibernate-entitymanager.jar”,Then problem is OK !
2 楼 dontal 2010-12-20  
Maybe your persistence.xml is put in a wrong folder, ranther than META-INF.
1 楼 29163077 2010-09-01  
能不能说中文 详细点?

相关推荐

    Running JPA Applications with Hibernate as a Third-Party Persistence Provider on SAP NetWeaver CE 7.1EHP1

    &lt;provider&gt;org.hibernate.jpa.HibernatePersistence&lt;/provider&gt; &lt;!-- ... --&gt; &lt;/persistence-unit&gt; ``` ###### 3.2.4 配置 persistence.xml 中的 JTA DataSource - 在 `&lt;persistence-unit&gt;` 元素中添加 `...

    javax.persistence.jar

    javax.persistence.EntityManager.class javax.persistence.EntityManagerFactory.class javax.persistence.EntityNotFoundException.class javax.persistence.EntityResult.class javax.persistence....

    EntityManager

    【EntityManager】是Java JPA(Java Persistence API)中的核心组件,负责管理Java对象与数据库之间的映射关系,实现ORM(Object-Relational Mapping)功能。它充当了一个中间层,简化了对数据库的操作,使得开发者...

    HIBERNATE - Relational Persistence for Idiomatic Java.chm

    从hibernate官网上 下载的HIBERNATE - Relational Persistence for Idiomatic Java.chm

    The Design of a Robust Persistence Layer For Relational Databases

    The Design of a Robust Persistence Layer For Relational Databases...In this white paper I present an overview of the design of a robust persistence layer for object-oriented applications. I have ...

    Hibernate EntityManager用法

    而Hibernate EntityManager则是JPA(Java Persistence API)规范的一个实现,它结合了Hibernate的功能与JPA的标准,使得开发者可以在遵循JPA规范的同时享受到Hibernate的高效性能。本文将深入探讨Hibernate ...

    HIBERNATE - Relational Persistence for Idiomatic Java

    "Relational Persistence for Idiomatic Java"这个标题表明Hibernate的核心功能是为Java程序员提供一种自然、地道的方式来处理关系型数据库的持久化。下面将详细阐述Hibernate的主要概念、API及其在Java开发中的应用...

    Hibernate EntityManager Document

    - **Persistence Context**:由EntityManager维护的一个缓存区域,用于存储当前事务内的实体状态。 - **Entity**:代表数据库表中的行,通常通过注解或XML配置映射到表结构。 ##### 1.2 EJB容器环境 - **Container-...

    Apress.Java.Persistence.for.Relational.Databases

    《Apress.Java.Persistence.for.Relational.Databases》这本书深入探讨了如何在Java应用程序中持久化关系型数据库中的数据。Java持久化是将程序中的对象状态存储到数据库中的过程,以便在后续的程序运行中能够恢复...

    EntityManager Demo

    【描述】:EntityManager是Java Persistence API (JPA)中的核心组件,主要用于管理实体(Entity)对象及其在数据库中的持久化操作。这个Demo将展示如何使用EntityManager进行基本的数据操作,包括创建、查询、更新和...

    3PAR高可用性解决方案 Peer Persistence for VMware

    3PAR Peer Persistence for VMware解决方案是一项针对VMware虚拟化环境的高可用性技术。这个技术由HP公司(现为Hewlett Packard Enterprise)开发,它允许两台位于不同地点的3PAR存储系统进行实时镜像复制,以确保...

    entitymanager(hibernate)

    而实体管理器(EntityManager)是Java Persistence API(JPA)的一部分,它提供了与Hibernate集成的关键接口,用于管理和操作数据。当我们谈论"entitymanager(hibernate)"时,意味着我们要探讨如何在Java项目中将这...

    javax.persistence-2.0.0.jar 包

    《Java持久化API(JPA)2.0详解——基于javax.persistence-2.0.0.jar包》 Java持久化API(Java Persistence API,简称JPA)是Java平台上的一个标准,用于管理关系数据库中的数据。它为Java应用程序提供了一种对象/...

    PHP Persistence(Apress,2016)

    Take the pain out of ... With this short book, you can save time and money by simply coding less while accomplishing more with the Doctrine persistence framework, a leading persistence solution for ...

    hibernate-entitymanager-3.2.jar.zip

    Hibernate EntityManager 是 Hibernate 项目的一部分,它是一个符合 JPA(Java Persistence API)规范的 ORM 解决方案,为开发者提供了一种更加面向对象的方式来处理数据库操作。在 Hibernate EntityManager 3.2 ...

    javax.persistence.jar.zip

    JPA的核心概念包括实体(Entity)、实体管理器(EntityManager)、实体工厂(EntityManagerFactory)、查询语言(JPQL,Java Persistence Query Language)等。实体是应用程序中的业务对象,它们通过注解与数据库表...

    javax.persistence.Entity 的jar包文件

    在更现代的项目中,通常会使用JPA 2.x,对应的jar包可能是`javax.persistence-api.jar`或者其他JPA供应商的实现库,如Hibernate的`hibernate-entitymanager.jar`。如果项目依赖EclipseLink,确保添加了完整的Eclipse...

Global site tag (gtag.js) - Google Analytics