Reputation: 150
i am using @Valid annotation at MO level to validate the input data, while it works fine with tomcat server, but during weblogic deployment i am getting below error:
Caused by: java.lang.ClassCastException: class org.eclipse.persistence.jpa.PersistenceProvider cannot be cast to class javax.persistence.spi.PersistenceProvider (org.eclipse.persistence.jpa.PersistenceProvider is in unnamed module of loader com.oracle.classloader.weblogic.LaunchClassLoader @3e92efc3; javax.persistence.spi.PersistenceProvider is in unnamed module of loader weblogic.utils.classloaders.ChangeAwareClassLoader @8ae852)
i have tried providing <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
in my persistence as before i was using default persistence unit but still the same problem.
I want to avoid loading of persistence unit from eclipselink.jar which is present at weblogic container, so that it would not get evaluated at the end.
Any help in this would be appreciated.
Hibernate JPA Version: hibernate-jpa-2.1-api-1.0.0.Final.jar:1.0.0.Final
Hibernate Validator version: hibernate-validator-5.4.0.Final.jar:5.4.0.Final
Upvotes: 0
Views: 655
Reputation: 1
in our case for use @Valid we deleted the lines below in weblogic.xml:
<wls:package-name>javax.persistence.*</wls:package-name>
<wls:package-name>javax.persistence.spi.*</wls:package-name>
Upvotes: 0