java.lang.ClassNotFoundException: com.mysql.jdbc.Driver项目连不上数据库异常,缺少mysql驱动

17 篇文章 0 订阅
11 篇文章 0 订阅

项目启动,数据库连接不上:

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
配置文件是ok的,缺少mysql驱动mysql-connector-java-5.1.25.jar

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值