2

I wanted to use EclipseLink for Spring Boot in my Spring Boot project. I was able to configure everything. But when I was implementing I found one strange thing. I had to include EclipseLink as implementation for JPA in my pom.xml. My first try was:

<groupId>org.eclipse.persistence</groupId>
<artifactId>eclipselink</artifactId>
<version>RELEASE</version>

However, when I was trying to run my code each time I received an exception:

Unable to create a Configuration, because no Bean Validation provider could be found. Add a provider like Hibernate Validator (RI) to your classpath.

I was searching on their website https://wiki.eclipse.org/EclipseLink/Maven and it is written there that dependency to EclipseLink should contain all the other implementation.

I tried to change dependency in pom.xml to:

<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.jpa</artifactId>
<version>RELEASE</version>

And everything works as expected. Does this dependency contains more than EclipseLink? Does not EclipseLink dependency contains implementation for bean validation?

Adam
  • 884
  • 7
  • 29
  • 1
    I found out that eclipselink contains dependency to javax.validation but it does not contain implementation for it. Dependency to org.eclipse.persistence.jpa does not contain javax.validation. – Adam Dec 11 '17 at 07:03

1 Answers1

2

Does this dependency contains more than EclipseLink?

Yes, if you see the pom.xml of org.eclipse.persistence.jpa dependency you'll find those dependencies:

<dependencies>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>javax.persistence</artifactId>
            <version>2.2.0</version>
            <type>jar</type>
            <scope>compile</scope>
            <optional>false</optional>
        </dependency>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>org.eclipse.persistence.asm</artifactId>
            <version>2.7.0</version>
            <type>jar</type>
            <scope>compile</scope>
            <optional>false</optional>
        </dependency>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>org.eclipse.persistence.antlr</artifactId>
            <version>2.7.0</version>
            <type>jar</type>
            <scope>compile</scope>
            <optional>false</optional>
        </dependency>
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.json</artifactId>
            <version>1.0.4</version>
            <type>jar</type>
            <scope>compile</scope>
            <optional>false</optional>
        </dependency>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>org.eclipse.persistence.jpa.jpql</artifactId>
            <version>2.7.0</version>
            <type>jar</type>
            <scope>compile</scope>
            <optional>false</optional>
        </dependency>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>org.eclipse.persistence.core</artifactId>
            <version>2.7.0</version>
            <type>jar</type>
            <scope>compile</scope>
            <optional>false</optional>
        </dependency>
    </dependencies>

Does not EclipseLink dependency contains implementation for bean validation?

You can check this link Bean validation

M.A.Bell
  • 398
  • 1
  • 16
  • I cannot find a dependency to org.eclipse.persistence.moxy.validation. Where is it located? – Adam Dec 25 '17 at 23:01
  • 2
    Ok, now I see that org.eclipse.persistence.jpa does not contain javax.validation but EclipseLink does. Thanks. – Adam Dec 28 '17 at 07:10