Digital Marketing

How to fix in Wildfly server: javax.persistence.PersistenceException: PersistenceProvider 'org.eclipse.persistence.jpa.PersistenceProvider' not found

GlassFish provides EclipseLink as JPA implementation while WildFly provides Hibernate. To be completely implementation independent, your code should reference classes from the package javax.persistence.* only. If it happens to reference classes from org.eclipse.persistence.*, then your application depends on EclipseLink to work properly. Whether you refactor it to use javax.persistence classes or you change WildFly to also include EclipseLink jars. In the last case, you can follow the instructions in the WildFly JPA Reference Guide. You can explicitly declare in the persistence.xml the use of EclipseLink instead of Hibernate by adding the tag provideras illustrated below:
    <persistence-unit name="i88-ca" transaction-type="JTA">
Then add the following dependence to your pom.xml file:

Despite rigorous tests to make sure that the implementation respects all specification requirements, there is always the risk of finding some differences. Therefore, do not forget to create new unit and integration tests for every refactoring you dealt with due to implementation differences.


Popular posts from this blog

Make online money from the Internet