title: Error instantiating Persistence Provider class java.lang.ClassNotFoundException: org.hibernate.ejb.HibernatePersistence
body: <p>On deploying EJB application on Weblogic : 12.2.1 , I am facing the exception : </p>
  
  <p>"Error instantiating the Persistence Provider class org.hibernate.ejb.HibernatePersistence of the PersistenceUnit entityManager: java.lang.ClassNotFoundException: org.hibernate.ejb.HibernatePersistence"</p>
  
  <p>I have the below configuration in persistence.xml to specify persistence provider</p>
  
  <pre><code>&lt;persistence-unit name="entityManager"&gt;
      &lt;!-- Use Hibernate persistency --&gt;  
      &lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt;
  </code></pre>
  
  <p>and below in weblogic-application.xml</p>
  
  <pre><code>&lt;prefer-application-packages&gt;
      &lt;package-name&gt;antlr.*&lt;/package-name&gt;
      &lt;package-name&gt;javax.persistence.*&lt;/package-name&gt;
  &lt;/prefer-application-packages&gt;
  </code></pre>
  
  <p>I followed the below link to check default persistence provider set in WL , which is TopLink. </p>
  
  <p><a href="https://docs.oracle.com/middleware/1213/wls/WLACH/taskhelp/domainconfig/ConfigureDefaultJPAProvider.html" rel="nofollow noreferrer">https://docs.oracle.com/middleware/1213/wls/WLACH/taskhelp/domainconfig/ConfigureDefaultJPAProvider.html</a></p>
  
  <p>Also , tried to set classpath valriables in setDomainEnv.cmd with hibernate-jpa-api.jar, slf4j-api.jar by below configuration and restarted server .Still facing same issue.</p>
  
  <pre><code>set EXT_PRE_CLASSPATH=C:\Projects\...\lib\hibernate\hibernate-jpa-api.jar;C:\Projects\...\lib\hibernate\slf4j-api.jar
  </code></pre>