0

I am currently using OpenJPA in one of my projects and got yet another problem. I defined some entities in my persistence.xml but OpenJPA doesnt seem to find them. While running my project I got this warning for every single entity registered in my persistence.xml:

WARN [http-nio-8080-exec-3] openjpa.MetaData - The class "Entitiy.Employee" listed in the openjpa.MetaDataFactory configuration property could not be loaded by ParallelWebappClassLoader`

And than I get this error:

org.apache.openjpa.persistence.ArgumentException: An error occurred while parsing the query filter "SELECT e FROM Employee e". Error message: The name "Employee" is not a recognized entity or identifier. Known entity names: []

Seems to me like not a single one of my entities declared in my persistence.xml can be found.

Here is my 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_2_0.xsd"
             version="2.0">
    <persistence-unit name="PesUnit">
        <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
        <class>Entitiy.Employee</class>
        ... all other classes listed the same way...
        <properties>
            <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
            <property name="openjpa.jdbc.SchemaFactory" value="native(ForeignKeys=true)"/>
            <property name="openjpa.jdbc.MappingDefaults" value="ForeignKeyDeleteAction=restrict, JoinForeignKeyDeleteAction=restrict"/>
            <property name="openjpa.ConnectionURL" value="jdbc:mysql://localhost:3306/somescheme"/>
            <property name="openjpa.ConnectionDriverName" value="com.mysql.jdbc.Driver"/>
            <property name="openjpa.ConnectionUserName" value="user"/>
            <property name="openjpa.ConnectionPassword" value="pass"/>
            <property name="openjpa.Log" value="DefaultLevel=WARN, Runtime=INFO, Tool=INFO, SQL=TRACE"/>
        </properties>
    </persistence-unit>
</persistence>

Can anybody help me?

Demli95
  • 136
  • 1
  • 12

0 Answers0