1

I'm new in JPA, and I keep getting error like this: enter image description here

Currently, I work with:

  • Java 8
  • Spring boot 2.1.4 Release
  • Hibernate 5.2.2 Finale
  • MySQL connector java 8.0.15
  • Gson 2.8.6

I'm seriously don't know what to do and what cause the error because, again, I'm new with JPA. Can anyone help me?

3
  • How you are building and running your project? Commented Nov 25, 2020 at 16:52
  • this error has nothing to do with JPA as such Commented Nov 25, 2020 at 16:57
  • Your screenshot shows you're using Java 15, not Java 8. JAXB was removed from Java in Java 11, and now you need to add an explicit dependency. Commented Nov 25, 2020 at 17:10

2 Answers 2

8

Seems you're not actually using Java 8. If you want to solve this for Java 11 or above, include these dependencies in your pom, as they're not part of the JDK anymore.

<dependency>
    <groupId>javax.xml.bind</groupId>
    <artifactId>jaxb-api</artifactId>
</dependency>
<dependency>
    <groupId>org.glassfish.jaxb</groupId>
    <artifactId>jaxb-runtime</artifactId>
</dependency>
Sign up to request clarification or add additional context in comments.

Comments

0

In your error screenshot you have error regarding "java-15" path but you claim to be using java 8. I think you are actually using java 15 but don't realize it. Java 15 doesn't have that namespace.

If you intend to work with java 8, I suggest you install and use that one - that shouldn't give you the error you're now getting.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.