0

Mi archivo persistence.xml esta asi:

<?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="efactory">      
            <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
            <description>Configuración de JPA para el acceso a la base de datos</description>
            <class>com.apiux.entities.PersonaTest</class>
            <properties>
            <property name="hibernate.connection.url" value="jdbc:postgresql://localhost:5432/apiux" />
                <property name="hibernate.connection.driver_class" value="org.postgresql.Driver" />
                <property name="hibernate.connection.username" value="postgres" />
                <property name="hibernate.connection.password" value="apiux" />
                <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
            </properties>
        </persistence-unit>

</persistence>

Pero al momento de iniciar el proceso e ingresar al endpoint para recuperar los datos me arroja el siguiente mensaje de error:

"JBWEB000065: HTTP Status 500 - javax.persistence.PersistenceException: No Persistence provider for EntityManager named efactory"

He revisado temas anteriores y todos aconsejan cambiar la etiqueta <provider>, lo hice pero no funciona.

¿Alguna idea o consejo?

1
  • ¿Está el fichero en el lugar correcto (.../META_INF)? el 9 ene. 2018 a las 14:54

1 respuesta 1

1

http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd" version="2.1">

<persistence-unit name="Persistencia" transaction-type="RESOURCE_LOCAL">

    <properties>
        <property name="javax.persistence.jdbc.driver" value="org.postgresql.Driver" /> <!-- DB Driver -->
        <property name="javax.persistence.jdbc.url" value="jdbc:postgresql://localhost:5432/hibernate" /> <!-- BD Mane -->
        <property name="javax.persistence.jdbc.user" value="postgres" /> <!-- DB User -->
        <property name="javax.persistence.jdbc.password" value="wester" /> <!-- DB Password -->

    <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/> <!-- DB Dialect -->
        <property name="hibernate.hbm2ddl.auto" value="update" /> <!-- create / create-drop / update -->

        <property name="hibernate.show_sql" value="true" /> <!-- Show SQL in console -->
        <property name="hibernate.format_sql" value="true" /> <!-- Show SQL formatted -->
    </properties>

</persistence-unit>

Tu Respuesta

Al pulsar en “Publica tu respuesta”, muestras tu consentimiento a nuestros términos de servicio, política de privacidad y política de cookies

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.