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

OFBiz项目启动时报错,无法连接数据库,原因是未找到MySQL驱动类。确认配置正确,但缺失mysql-connector-java-5.1.25.jar。
部署运行你感兴趣的模型镜像

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

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

您可能感兴趣的与本文相关的镜像

Llama Factory

Llama Factory

模型微调
LLama-Factory

LLaMA Factory 是一个简单易用且高效的大型语言模型(Large Language Model)训练与微调平台。通过 LLaMA Factory,可以在无需编写任何代码的前提下,在本地完成上百种预训练模型的微调

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值