Not sure if this is a hibernate validation, jpa or osgi issue but wonder if anyone here might have encountered this and solved it.
While looking for a solution I came across this;
https://docs.jboss.org/hibernate/stable/validator/reference/en-US/html_single/?v=6.0#_jpa
which says; “If you are using JPA 2 and Hibernate Validator is in the classpath, the JPA2 specification requires that Bean Validation gets enabled”.
I therefore installed the hibernate-validation feature followed by the open-jpa feature. In my JPA bundle meta file I add the validation packages under Import-Package (javax.validation, javax.validation.constraints, org.hibernate.validator).
So doesn’t this mean that Hibernate Validator is in the classpath? Shouldn’t JPA be automatically picking this without any flags in persistence.xml?
I install both hibernate validator and openjpa using the feature:install option that comes with Karaf. I did manage to get hibernate validator to work when I specifically write code to validate a class. What I am trying to achieve the JPA to automatically validate objects before persisting.