我是靠谱客的博主 完美外套,最近开发中收集的这篇文章主要介绍记录一次gradle依赖问题的解决思路:Failed to determine a suitable driver class,觉得挺不错的,现在分享给大家,希望可以做个参考。
概述
问题关键字
Failed to determine a suitable driver class
问题描述
报错信息如下:
2019-03-06 09:53:43.991|localhost-startStop-1|INFO |o.s.cloud.alibaba.sentinel.SentinelWebAutoConfiguration.servletRequestListener:73|[Sentinel Starter] register Sentinel with urlPatterns: [/*].
2019-03-06 09:53:44.723|localhost-startStop-1|INFO |o.s.boot.web.servlet.FilterRegistrationBean.log:87|Mapping filter: 'commonFilter' to urls: [/*]
2019-03-06 09:53:44.723|localhost-startStop-1|INFO |o.s.boot.web.servlet.FilterRegistrationBean.log:87|Mapping filter: 'characterEncodingFilter' to: [/*]
2019-03-06 09:53:44.723|localhost-startStop-1|INFO |o.s.boot.web.servlet.FilterRegistrationBean.log:87|Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2019-03-06 09:53:44.724|localhost-startStop-1|INFO |o.s.boot.web.servlet.FilterRegistrationBean.log:87|Mapping filter: 'httpPutFormContentFilter' to: [/*]
2019-03-06 09:53:44.724|localhost-startStop-1|INFO |o.s.boot.web.servlet.FilterRegistrationBean.log:87|Mapping filter: 'requestContextFilter' to: [/*]
2019-03-06 09:53:44.724|localhost-startStop-1|INFO |o.s.boot.web.servlet.FilterRegistrationBean.log:87|Mapping filter: 'cat-filter' to urls: [/*]
2019-03-06 09:53:44.724|localhost-startStop-1|INFO |o.s.boot.web.servlet.FilterRegistrationBean.log:87|Mapping filter: 'sentinelFilter' to urls: [/*]
2019-03-06 09:53:44.724|localhost-startStop-1|INFO |o.s.boot.web.servlet.FilterRegistrationBean.log:87|Mapping filter: 'httpCatCrossFliter' to urls: [/*]
2019-03-06 09:53:44.724|localhost-startStop-1|INFO |o.s.boot.web.servlet.FilterRegistrationBean.log:87|Mapping filter: 'corsInterceptor' to: [/*]
2019-03-06 09:53:44.725|localhost-startStop-1|INFO |o.s.boot.web.servlet.ServletRegistrationBean.log:87|Servlet dispatcherServlet mapped to [/]
2019-03-06 09:53:44.795|restartedMain|INFO |org.springframework.aop.framework.CglibAopProxy.log:87|Method [void com.zaxxer.hikari.HikariConfig.seal()] is package-visible across different ClassLoaders and cannot get proxied via CGLIB: Declare this method as public or protected if you need to support invocations through the proxy.
2019-03-06 09:53:44.956|restartedMain|WARN |o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext.log:87|Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Unsatisfied dependency expressed through method 'entityManagerFactory' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'entityManagerFactoryBuilder' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Unsatisfied dependency expressed through method 'entityManagerFactoryBuilder' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaVendorAdapter' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.orm.jpa.JpaVendorAdapter]: Factory method 'jpaVendorAdapter' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
2019-03-06 09:53:44.961|restartedMain|WARN |o.s.beans.factory.support.DisposableBeanAdapter.log:87|Invocation of destroy method failed on bean with name 'inMemoryDatabaseShutdownExecutor': org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
2019-03-06 09:53:44.997|restartedMain|INFO |org.apache.catalina.core.StandardService.log:180|Stopping service [Tomcat]
2019-03-06 09:53:45.024|localhost-startStop-1|WARN |org.apache.catalina.loader.WebappClassLoaderBase.log:180|The web application [api] appears to have started a thread named [sentinel-datasource-auto-refresh-task-thread-1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)
2019-03-06 09:53:45.025|localhost-startStop-1|WARN |org.apache.catalina.loader.WebappClassLoaderBase.log:180|The web application [api] appears to have started a thread named [sentinel-metrics-record-task-thread-1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)
Disconnected from the target VM, address: '127.0.0.1:59182', transport: 'socket'
Process finished with exit code 1
思考起因
添加了一个依赖之后
排查原因
查看这个依赖是否依赖了别的其他依赖,
查找之后确实如此;
解决方案
排除依赖
compile 'com.xxx.cloud:xxx-client:0.0.1-SNAPSHOT' , {
exclude(module: 'spring-boot-starter-data-jpa')
}
最后
以上就是完美外套为你收集整理的记录一次gradle依赖问题的解决思路:Failed to determine a suitable driver class的全部内容,希望文章能够帮你解决记录一次gradle依赖问题的解决思路:Failed to determine a suitable driver class所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复