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
版权声明:本文标题:hibernate - Configuration of a TomcatEE Datasource - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736642897a1946037.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论