Java Can';使用eclipse和eclipselink生成表格实体

Java Can';使用eclipse和eclipselink生成表格实体,java,eclipse,jpa,eclipselink,Java,Eclipse,Jpa,Eclipselink,我尝试用我的实体生成数据库结构。为此,我使用Eclipse工具。我有开普勒版本,但我也用朱诺测试过 “右键单击项目->JPA工具->从实体生成表” 但是eclipse失败了,出现了一个奇怪的错误: Exception in thread "main" javax.persistence.PersistenceException: Found 'javax.persistence.provider' property in the map but the value is not a String

我尝试用我的实体生成数据库结构。为此,我使用Eclipse工具。我有开普勒版本,但我也用朱诺测试过

“右键单击项目->JPA工具->从实体生成表”

但是eclipse失败了,出现了一个奇怪的错误:

Exception in thread "main" javax.persistence.PersistenceException: Found 'javax.persistence.provider' property in the map but the value is not a String. Found object : 'null'.
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:131)
at org.eclipse.jpt.jpa.eclipselink.core.ddlgen.Main.buildEntityManagerFactory(Main.java:94)
at org.eclipse.jpt.jpa.eclipselink.core.ddlgen.Main.execute(Main.java:80)
at org.eclipse.jpt.jpa.eclipselink.core.ddlgen.Main.main(Main.java:68)
这是我的persistence.xml

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" 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_2_0.xsd">
<persistence-unit name="myApp" transaction-type="RESOURCE_LOCAL">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <exclude-unlisted-classes>false</exclude-unlisted-classes>
    <shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode>
    <properties>
        <property name="javax.persistence.jdbc.url" value="jdbc:postgresql://localhost:5432/superng"/>
        <property name="javax.persistence.jdbc.user" value="postgres"/>
        <property name="javax.persistence.jdbc.password" value="changeit"/>
        <property name="javax.persistence.jdbc.driver" value="org.postgresql.Driver"/>
        <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
        <property name="eclipselink.ddl-generation.output-mode" value="sql-script"/>
    </properties>
</persistence-unit>

org.eclipse.persistence.jpa.PersistenceProvider
假的
启用\u选择性


为什么失败?

我认为
persistence.xml
没有问题,但是JavaEE-jar和另一个包含
javax.persistence.*
包的jar之间存在冲突。您需要修改JavaEEJAR或确保类路径中只有一个版本的
javax.persistence.
包。

我有两个版本的javax.persistence.*。一个是用户库,一个是JOnAS服务器(过时)。你很难发现这个例外,最近我遇到了这个例外