admin管理员组

文章数量:1124672

I m trying to get an Entitymanager running. What do I have: TomcatEE10, Java17, Hibernate 5. My persistance.xml ist configured like:

<persistence-unit name="HUGO" transaction-type="RESOURCE_LOCAL">
        <properties>
            <property name="jakarta.persistence.jdbc.url" value="jdbc:postgresql://localhost:5432/HUGODB"/>
            <property name="jakarta.persistence.jdbc.user" value="hugo"/>
            <property name="jakarta.persistence.jdbc.password" value="hugopw"/>
            <property name="jakarta.persistence.jdbc.driver" value="org.postgresql.Driver"/>
            <property name="hibernate.hbm2ddl.ddl-auto" value="validate"/>
            <property name="hibernate.show_sql" value="false"/>
            <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
        </properties>
    </persistence-unit>

But, when i try to use it in java:

EntityManagerFactory emf = Persistence.createEntityManagerFactory("HUGO");

I got the error: <openjpa-4.0.1-r4c5a46e fatal user error> org.apache.openjpa.persistence.ArgumentException: The persistence provider is attempting to use properties in the persistence.xml file to resolve the data source. A Java Database Connectivity (JDBC) driver or data source class name must be specified in the openjpa.ConnectionDriverName or jakarta.persistence.jdbc.driver property. The following properties are available in the configuration: "org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl@f4cede5d".

I searched around the internet, but didnt found anything helpfull... Could somebody help me please? What I m doing wrong in my persistence?

本文标签: hibernateConfiguration of a TomcatEE DatasourceStack Overflow