Home  >  Article  >  Java  >  Why am I getting \'Error creating bean...\' when using Spring Data JPA?

Why am I getting \'Error creating bean...\' when using Spring Data JPA?

Barbara Streisand
Barbara StreisandOriginal
2024-10-29 01:58:30864browse

Why am I getting

Troubleshooting "Error creating bean...": JPA vs. Hibernate

When using Spring Data JPA, an error can occur if the necessary Hibernate dependencies are not included in the project. To resolve this issue:

  1. Add the following dependencies to your pom.xml file:
<code class="xml"><dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-core</artifactId>
    <version>4.1.4.Final</version>
</dependency>
<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-entitymanager</artifactId>
    <version>5.2.3.Final</version>
</dependency></code>

Alternatively, you can simply add the following dependency:

<code class="xml"><dependency>
    <groupId>javax.xml.bind</groupId>
    <artifactId>jaxb-api</artifactId>
    <version>2.3.0</version>
</dependency></code>

The above is the detailed content of Why am I getting \'Error creating bean...\' when using Spring Data JPA?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn