I have a problem with Java Persistence API and Hibernate. My situation of project is:

enter image description here

My persistence.xml file is:

<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="JPA">
        <provider>org.hibernate.ejb.HibernatePersistence</provider>
        <class>com.david.Libro</class>
        <class>com.david.Categoria</class>
        <properties>
            <property name="hibernate.show_sql" value="true" />
            <property name="javax.persistence.transactionType" value="RESOURCE_LOCAL" />
            <property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
            <property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost/arquitecturaJava" />
            <property name="javax.persistence.jdbc.user" value="root" />
            <property name="javax.persistence.jdbc.password" value="root" />
            <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect" />
        </properties>
    </persistence-unit>
</persistence>

And i create EntityManagerFactory in:

private static EntityManagerFactory buildEntityManagerFactory() 
    {
        try 
        {
            return Persistence.createEntityManagerFactory("JPA");
        } 
        catch (Throwable ex) 
        {
                    ex.printStackTrace();
         
Edit
Report