title: Configuration error. Class [com.mysql.cj.jdbc.Driver] not found. EclipseLink, MySQL driver
body: <p>I am trying to learn JPA using EclipseLink. I am using Mysql as my DB. I have added the all the dependencies required and below is my pom.xml
  </p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;org.eclipse.persistence&lt;/groupId&gt;
          &lt;artifactId&gt;eclipselink&lt;/artifactId&gt;
          &lt;version&gt;2.7.0&lt;/version&gt;
          &lt;exclusions&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;org.eclipse.persistence&lt;/groupId&gt;
                  &lt;artifactId&gt;javax.persistence&lt;/artifactId&gt;
              &lt;/exclusion&gt;
          &lt;/exclusions&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.eclipse.persistence&lt;/groupId&gt;
          &lt;artifactId&gt;javax.persistence&lt;/artifactId&gt;
          &lt;version&gt;2.1.1&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;mysql&lt;/groupId&gt;
          &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
          &lt;version&gt;8.0.11&lt;/version&gt;
          &lt;scope&gt;runtime&lt;/scope&gt;
      &lt;/dependency&gt;
  
  &lt;/dependencies&gt;
  </code></pre>
  
  <p>The issue is that even though maven has downloaded all the required jars for mysql jdbc connector I am getting Exception Description: Configuration error.  Class [com.mysql.cj.jdbc.Driver] not found. Following are the version I am using:
  1. Mysql JDBC connector : 8.0.11
  2. Eclipselink: 2.7.1
  3. JPA: 2.2.0</p>
  
  <p>Attached is the screenshot of my Maven dependencies jars. </p>
  
  <p>I tried all the suggestions from other threads on stackoverflow but couldn't resolve the issue.</p>
  
  <p>Appreciate your help and thanks in advance !</p>
  
  <p>Below is my persistence.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="http://java.sun.com/xml/ns/persistence 
     http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"&gt;
  
     &lt;persistence-unit name="Eclipselink_JPA" transaction-type="RESOURCE_LOCAL"&gt;
  
        &lt;provider&gt;org.eclipse.persistence.jpa.PersistenceProvider&lt;/provider&gt;
        &lt;exclude-unlisted-classes&gt;false&lt;/exclude-unlisted-classes&gt;
  
        &lt;properties&gt;
           &lt;property name="javax.persistence.jdbc.driver" value="com.mysql.cj.jdbc.Driver"/&gt;
           &lt;property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/jpadb"/&gt;
           &lt;property name="javax.persistence.jdbc.user" value="root"/&gt;
           &lt;property name="javax.persistence.jdbc.password" value="root"/&gt;
           &lt;property name="eclipselink.logging.level" value="FINE"/&gt;
           &lt;property name="eclipselink.ddl-generation" value="create-tables"/&gt;
        &lt;/properties&gt;
  
     &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  </code></pre>
  
  <p>Also, adding the error stack trace:</p>
  
  <p>[EL Fine]: server: 2018-06-24 17:33:10.619--Thread(Thread[main,5,main])--Configured server platform: org.eclipse.persistence.platform.server.NoServerPlatform
  [EL Info]: 2018-06-24 17:33:11.065--ServerSession(1101598632)--Thread(Thread[main,5,main])--EclipseLink, version: Eclipse Persistence Services - 2.6.5.v20170607-b3d05bd
  [EL Severe]: ejb: 2018-06-24 17:33:11.068--ServerSession(1101598632)--Thread(Thread[main,5,main])--Exception [EclipseLink-4003] (Eclipse Persistence Services - 2.6.5.v20170607-b3d05bd): org.eclipse.persistence.exceptions.DatabaseException
  Exception Description: Configuration error.  Class [com.mysql.cj.jdbc.Driver] not found.
  Exception in thread "main" javax.persistence.PersistenceException: Exception [EclipseLink-4003] (Eclipse Persistence Services - 2.6.5.v20170607-b3d05bd): org.eclipse.persistence.exceptions.DatabaseException
  Exception Description: Configuration error.  Class [com.mysql.cj.jdbc.Driver] not found.
      at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:818)
      at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getAbstractSession(EntityManagerFactoryDelegate.java:207)
      at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:307)
      at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:337)
      at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:303)
      at practice.JPA.persistence.App.main(App.java:17)
  Caused by: Exception [EclipseLink-4003] (Eclipse Persistence Services - 2.6.5.v20170607-b3d05bd): org.eclipse.persistence.exceptions.DatabaseException
  Exception Description: Configuration error.  Class [com.mysql.cj.jdbc.Driver] not found.
      at org.eclipse.persistence.exceptions.DatabaseException.configurationErrorClassNotFound(DatabaseException.java:89)
      at org.eclipse.persistence.sessions.DefaultConnector.loadDriverClass(DefaultConnector.java:267)
      at org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:85)
      at org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:162)
      at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.setOrDetectDatasource(DatabaseSessionImpl.java:214)
      at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:776)
      at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:265)
      at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:734)
      ... 5 more</p>