【发布时间】:2014-04-14 18:53:15
【问题描述】:
我尝试构建这个 jpa 项目,但遇到了同样的错误。 我更新了,改变了一切,仍然一无所获。我错过了什么?我只在库中使用 EclipseLink (JPA 2.0)。 NetBeans IDE 7.2。
An annotation processor threw an uncaught exception.
Consult the following stack trace for details.
java.lang.RuntimeException: Exception [EclipseLink-25008] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.XMLMarshalException
Exception Description: A descriptor with default root element {http://xmlns.jcp.org/xml/ns/persistence}persistence was not found in the project
at org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor.process(CanonicalModelProcessor.java:407)
.
.
.
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:541)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)
Caused by: Exception [EclipseLink-25008] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.XMLMarshalException
Exception Description: A descriptor with default root element {http://xmlns.jcp.org/xml/ns/persistence}persistence was not found in the project
at org.eclipse.persistence.exceptions.XMLMarshalException.noDescriptorWithMatchingRootElement(XMLMarshalException.java:129)
.
.
.
at org.eclipse.persistence.internal.jpa.modelgen.objects.PersistenceUnitReader.<init>(PersistenceUnitReader.java:71)
at org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor.process(CanonicalModelProcessor.java:376)
... 49 more
C:\Users\drhorvath57\Desktop\nyomt\PizzaJPA\PizzaJPA\nbproject\build-impl.xml:926: The following error occurred while executing this line:
C:\Users\drhorvath57\Desktop\nyomt\PizzaJPA\PizzaJPA\nbproject\build-impl.xml:268: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 1 second)
persistence.xml:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="PizzaJPAPU" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<class>logic.entity.Pizza</class>
<class>logic.entity.Topping</class>
<class>logic.entity.Combination</class>
<properties>
<property name="javax.persistence.jdbc.url" value="jdbc:derby://localhost:1527/PizzaJPA"/>
<property name="javax.persistence.jdbc.password" value="APP"/>
<property name="javax.persistence.jdbc.driver" value="org.apache.derby.jdbc.ClientDriver"/>
<property name="javax.persistence.jdbc.user" value="APP"/>
<property name="eclipselink.ddl-generation" value="create-tables"/>
</properties>
</persistence-unit>
</persistence>
【问题讨论】:
标签: java xml hibernate jpa runtimeexception