java.lang.ClassNotFoundException : com.mysql.jdbc . driver project cannot connect to database, exception, lack of MySQL driver

Project started, database connection failed:

2018-06-26 14:01:00,168 |OFBiz-JobPoller      |DBCPConnectionFactory         |E| null
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_161]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_161]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_161]
	at java.lang.Class.forName0(Native Method) ~[?:1.8.0_161]
	at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_161]
	at org.ofbiz.entity.connection.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:88) [ofbiz-entity.jar:?]
	at org.ofbiz.geronimo.GeronimoTransactionFactory.getConnection(GeronimoTransactionFactory.java:83) [ofbiz-geronimo.jar:?]
	at org.ofbiz.entity.jdbc.SQLProcessor.getConnection(SQLProcessor.java:260) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.jdbc.SQLProcessor.prepareStatement(SQLProcessor.java:366) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.datasource.GenericDAO.selectListIteratorByCondition(GenericDAO.java:763) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.datasource.GenericHelperDAO.findListIteratorByCondition(GenericHelperDAO.java:140) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.GenericDelegator.find(GenericDelegator.java:1775) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.GenericDelegator.findList(GenericDelegator.java:1811) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.util.EntityQuery.query(EntityQuery.java:451) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.util.EntityQuery.queryList(EntityQuery.java:376) [ofbiz-entity.jar:?]
	at org.ofbiz.service.job.JobManager.reloadCrashedJobs(JobManager.java:294) [ofbiz-service.jar:?]
	at org.ofbiz.service.job.JobPoller$JobManagerPoller.run(JobPoller.java:223) [ofbiz-service.jar:?]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_161]
2018-06-26 14:01:00,168 |OFBiz-JobPoller      |GenericDelegator              |E| Failure in findByCondition operation for entity [JobSandbox]: org.ofbiz.entity.GenericEntityException: com.mysql.jdbc.Driver (com.mysql.jdbc.Driver). Rolling back transaction.
org.ofbiz.entity.GenericEntityException: com.mysql.jdbc.Driver (com.mysql.jdbc.Driver)
	at org.ofbiz.entity.connection.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:91) ~[ofbiz-entity.jar:?]
	at org.ofbiz.geronimo.GeronimoTransactionFactory.getConnection(GeronimoTransactionFactory.java:83) ~[ofbiz-geronimo.jar:?]
	at org.ofbiz.entity.jdbc.SQLProcessor.getConnection(SQLProcessor.java:260) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.jdbc.SQLProcessor.prepareStatement(SQLProcessor.java:366) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.datasource.GenericDAO.selectListIteratorByCondition(GenericDAO.java:763) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.datasource.GenericHelperDAO.findListIteratorByCondition(GenericHelperDAO.java:140) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.GenericDelegator.find(GenericDelegator.java:1775) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.GenericDelegator.findList(GenericDelegator.java:1811) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.util.EntityQuery.query(EntityQuery.java:451) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.util.EntityQuery.queryList(EntityQuery.java:376) [ofbiz-entity.jar:?]
	at org.ofbiz.service.job.JobManager.reloadCrashedJobs(JobManager.java:294) [ofbiz-service.jar:?]
	at org.ofbiz.service.job.JobPoller$JobManagerPoller.run(JobPoller.java:223) [ofbiz-service.jar:?]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_161]
Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_161]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_161]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_161]
	at java.lang.Class.forName0(Native Method) ~[?:1.8.0_161]
	at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_161]
	at org.ofbiz.entity.connection.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:88) ~[ofbiz-entity.jar:?]
	... 12 more
2018-06-26 14:01:00,168 |OFBiz-JobPoller      |JobManager                    |W| Unable to load crashed jobs
org.ofbiz.entity.GenericEntityException: org.ofbiz.entity.GenericEntityException: com.mysql.jdbc.Driver (com.mysql.jdbc.Driver) (com.mysql.jdbc.Driver (com.mysql.jdbc.Driver))
	at org.ofbiz.entity.GenericDelegator.findList(GenericDelegator.java:1831) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.util.EntityQuery.query(EntityQuery.java:451) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.util.EntityQuery.queryList(EntityQuery.java:376) ~[ofbiz-entity.jar:?]
	at org.ofbiz.service.job.JobManager.reloadCrashedJobs(JobManager.java:294) [ofbiz-service.jar:?]
	at org.ofbiz.service.job.JobPoller$JobManagerPoller.run(JobPoller.java:223) [ofbiz-service.jar:?]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_161]
Caused by: org.ofbiz.entity.GenericEntityException: com.mysql.jdbc.Driver (com.mysql.jdbc.Driver)
	at org.ofbiz.entity.connection.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:91) ~[ofbiz-entity.jar:?]
	at org.ofbiz.geronimo.GeronimoTransactionFactory.getConnection(GeronimoTransactionFactory.java:83) ~[ofbiz-geronimo.jar:?]
	at org.ofbiz.entity.jdbc.SQLProcessor.getConnection(SQLProcessor.java:260) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.jdbc.SQLProcessor.prepareStatement(SQLProcessor.java:366) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.datasource.GenericDAO.selectListIteratorByCondition(GenericDAO.java:763) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.datasource.GenericHelperDAO.findListIteratorByCondition(GenericHelperDAO.java:140) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.GenericDelegator.find(GenericDelegator.java:1775) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.GenericDelegator.findList(GenericDelegator.java:1811) ~[ofbiz-entity.jar:?]
	... 5 more
Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_161]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_161]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_161]
	at java.lang.Class.forName0(Native Method) ~[?:1.8.0_161]
	at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_161]
	at org.ofbiz.entity.connection.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:88) ~[ofbiz-entity.jar:?]
	at org.ofbiz.geronimo.GeronimoTransactionFactory.getConnection(GeronimoTransactionFactory.java:83) ~[ofbiz-geronimo.jar:?]
	at org.ofbiz.entity.jdbc.SQLProcessor.getConnection(SQLProcessor.java:260) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.jdbc.SQLProcessor.prepareStatement(SQLProcessor.java:366) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.datasource.GenericDAO.selectListIteratorByCondition(GenericDAO.java:763) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.datasource.GenericHelperDAO.findListIteratorByCondition(GenericHelperDAO.java:140) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.GenericDelegator.find(GenericDelegator.java:1775) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.GenericDelegator.findList(GenericDelegator.java:1811) ~[ofbiz-entity.jar:?]
	... 5 more
2018-06-26 14:01:00,171 |OFBiz-JobPoller      |DBCPConnectionFactory         |E| null
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_161]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_161]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_161]
	at java.lang.Class.forName0(Native Method) ~[?:1.8.0_161]
	at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_161]
	at org.ofbiz.entity.connection.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:88) [ofbiz-entity.jar:?]
	at org.ofbiz.geronimo.GeronimoTransactionFactory.getConnection(GeronimoTransactionFactory.java:83) [ofbiz-geronimo.jar:?]
	at org.ofbiz.entity.jdbc.SQLProcessor.getConnection(SQLProcessor.java:260) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.jdbc.SQLProcessor.prepareStatement(SQLProcessor.java:366) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.datasource.GenericDAO.selectListIteratorByCondition(GenericDAO.java:763) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.datasource.GenericHelperDAO.findListIteratorByCondition(GenericHelperDAO.java:140) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.GenericDelegator.find(GenericDelegator.java:1775) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.util.EntityQuery.queryIterator(EntityQuery.java:392) [ofbiz-entity.jar:?]
	at org.ofbiz.service.job.JobManager.poll(JobManager.java:194) [ofbiz-service.jar:?]
	at org.ofbiz.service.job.JobPoller$JobManagerPoller.run(JobPoller.java:224) [ofbiz-service.jar:?]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_161]
2018-06-26 14:01:00,171 |OFBiz-JobPoller      |JobManager                    |W| Exception thrown while polling JobSandbox: 
org.ofbiz.entity.GenericEntityException: com.mysql.jdbc.Driver (com.mysql.jdbc.Driver)
	at org.ofbiz.entity.connection.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:91) ~[ofbiz-entity.jar:?]
	at org.ofbiz.geronimo.GeronimoTransactionFactory.getConnection(GeronimoTransactionFactory.java:83) ~[ofbiz-geronimo.jar:?]
	at org.ofbiz.entity.jdbc.SQLProcessor.getConnection(SQLProcessor.java:260) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.jdbc.SQLProcessor.prepareStatement(SQLProcessor.java:366) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.datasource.GenericDAO.selectListIteratorByCondition(GenericDAO.java:763) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.datasource.GenericHelperDAO.findListIteratorByCondition(GenericHelperDAO.java:140) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.GenericDelegator.find(GenericDelegator.java:1775) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.util.EntityQuery.queryIterator(EntityQuery.java:392) ~[ofbiz-entity.jar:?]
	at org.ofbiz.service.job.JobManager.poll(JobManager.java:194) [ofbiz-service.jar:?]
	at org.ofbiz.service.job.JobPoller$JobManagerPoller.run(JobPoller.java:224) [ofbiz-service.jar:?]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_161]
Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_161]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_161]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_161]
	at java.lang.Class.forName0(Native Method) ~[?:1.8.0_161]
	at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_161]
	at org.ofbiz.entity.connection.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:88) ~[ofbiz-entity.jar:?]
	... 10 more
2018-06-26 14:01:30,173 |OFBiz-JobPoller      |DBCPConnectionFactory         |E| null
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_161]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_161]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_161]
	at java.lang.Class.forName0(Native Method) ~[?:1.8.0_161]
	at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_161]
	at org.ofbiz.entity.connection.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:88) [ofbiz-entity.jar:?]
	at org.ofbiz.geronimo.GeronimoTransactionFactory.getConnection(GeronimoTransactionFactory.java:83) [ofbiz-geronimo.jar:?]
	at org.ofbiz.entity.jdbc.SQLProcessor.getConnection(SQLProcessor.java:260) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.jdbc.SQLProcessor.prepareStatement(SQLProcessor.java:366) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.datasource.GenericDAO.selectListIteratorByCondition(GenericDAO.java:763) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.datasource.GenericHelperDAO.findListIteratorByCondition(GenericHelperDAO.java:140) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.GenericDelegator.find(GenericDelegator.java:1775) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.util.EntityQuery.queryIterator(EntityQuery.java:392) [ofbiz-entity.jar:?]
	at org.ofbiz.service.job.JobManager.poll(JobManager.java:194) [ofbiz-service.jar:?]
	at org.ofbiz.service.job.JobPoller$JobManagerPoller.run(JobPoller.java:224) [ofbiz-service.jar:?]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_161]
2018-06-26 14:01:30,173 |OFBiz-JobPoller      |JobManager                    |W| Exception thrown while polling JobSandbox: 
org.ofbiz.entity.GenericEntityException: com.mysql.jdbc.Driver (com.mysql.jdbc.Driver)
	at org.ofbiz.entity.connection.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:91) ~[ofbiz-entity.jar:?]
	at org.ofbiz.geronimo.GeronimoTransactionFactory.getConnection(GeronimoTransactionFactory.java:83) ~[ofbiz-geronimo.jar:?]
	at org.ofbiz.entity.jdbc.SQLProcessor.getConnection(SQLProcessor.java:260) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.jdbc.SQLProcessor.prepareStatement(SQLProcessor.java:366) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.datasource.GenericDAO.selectListIteratorByCondition(GenericDAO.java:763) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.datasource.GenericHelperDAO.findListIteratorByCondition(GenericHelperDAO.java:140) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.GenericDelegator.find(GenericDelegator.java:1775) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.util.EntityQuery.queryIterator(EntityQuery.java:392) ~[ofbiz-entity.jar:?]
	at org.ofbiz.service.job.JobManager.poll(JobManager.java:194) [ofbiz-service.jar:?]
	at org.ofbiz.service.job.JobPoller$JobManagerPoller.run(JobPoller.java:224) [ofbiz-service.jar:?]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_161]
Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_161]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_161]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_161]
	at java.lang.Class.forName0(Native Method) ~[?:1.8.0_161]
	at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_161]
	at org.ofbiz.entity.connection.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:88) ~[ofbiz-entity.jar:?]
	... 10 more

The configuration file is OK and lacks the MySQL driver mysql-connector-java-5.1.25.jar

Read More: