title: Liberty: How to change default JPA provider?
body: <p>In order to program against the JPA 2.1 API, I would like to use eclipseLink, rather than the default OpenJPA JPA provider. How can this be achieved in the WAS 8.5 Liberty profile?</p>
  
  <p>I tried with not using the jpa-2.0 feature and setting up a shared library which is referenced by my webapp, but with no success.</p>
  
  <p>Here's my server.xml:</p>
  
  <pre><code>&lt;server description="new server"&gt;
  
  &lt;!-- Enable features --&gt;
  &lt;featureManager&gt;
      &lt;feature&gt;jsp-2.2&lt;/feature&gt;
      &lt;feature&gt;localConnector-1.0&lt;/feature&gt;
  &lt;/featureManager&gt;
  
  &lt;httpEndpoint host="localhost" httpPort="9080" httpsPort="9443"
      id="defaultHttpEndpoint" /&gt;
  
  &lt;applicationMonitor updateTrigger="mbean" /&gt;
  
  &lt;webApplication id="System" location="System.war" name="System"&gt;
      &lt;classloader commonLibraryRef="mysql" /&gt;
      &lt;classloader commonLibraryRef="eclipseLink" /&gt;
  &lt;/webApplication&gt;
  
  &lt;library id="mysql" name="mysql-jdbc-driver"&gt;
      &lt;fileset dir="C:\Users\jacomac\.m2\repository\mysql\mysql-connector-java\5.1.26" includes="*.jar"/&gt;
  &lt;/library&gt;
  
  &lt;library id="eclipseLink" name="eclipse-jpa-impl"&gt;
      &lt;fileset dir="C:\Users\jacomac\.m2\repository\org\eclipse\persistence\eclipselink\2.5.2-M1" includes="*.jar"/&gt;
      &lt;fileset dir="C:\Users\jacomac\.m2\repository\org\eclipse\persistence\javax.persistence\2.1.0" includes="*.jar"/&gt;
      &lt;fileset dir="C:\Users\jacomac\.m2\repository\org\eclipse\persistence\commonj.sdo\2.1.1" includes="*.jar"/&gt;
  &lt;/library&gt;
  &lt;/server&gt;
  </code></pre>
  
  <p>This is the error I get:</p>
  
  <pre><code>java.lang.NoClassDefFoundError: javax/persistence/Persistence
  </code></pre>
  
  <p>An addition: I know it works if I supply the eclipseLink libraries in my webapp, but I would like to use it as a shared resource across multiple webapps.</p>