首页 > 其他分享 >Connections could not be acquired from the underlying database!

Connections could not be acquired from the underlying database!

时间:2023-05-19 09:23:08浏览次数:47  
标签:java invoke acquired could springframework Connections mchange org com

报错内容:

五月 19, 2023 9:02:42 上午 org.apache.catalina.core.StandardWrapperValve invoke
严重: 在路径为的上下文中,Servlet[springmvc]的Servlet.service()引发了具有根本原因的异常Request processing failed; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!
com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1406)
at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:594)
at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:514)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutAndMarkConnectionInUse(C3P0PooledConnectionPool.java:743)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:670)
at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:205)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373)
at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:420)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:257)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
at com.sun.proxy.$Proxy22.query4Login(Unknown Source)
at com.atguigu.atcrowdfunding.controller.DispatcherController.doAJAXLogin(DispatcherController.java:59)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)

解决方案:

分两步:

  • mysql 驱动从5 升级到 8 连接方式 
  • <property name="driverClass" value="com.mysql.jdbc.Driver"/> 修改为  <property name="driverClass" value="com.mysql.cj.jdbc.Driver"/>

标签:java,invoke,acquired,could,springframework,Connections,mchange,org,com
From: https://www.cnblogs.com/lixiuming521125/p/17413923.html

相关文章

  • Spring Could not find unique TaskExecutor bean 错误
    这个错误其实是debug级别的错误,是不影响运行的。错误栈为:15:27:57.726DEBUG12844---[nio-8080-exec-1].s.a.AnnotationAsyncExecutionInterceptor:CouldnotfinduniqueTaskExecutorbeanorg.springframework.beans.factory.NoUniqueBeanDefinitionException:Noqu......
  • python:ERROR: Could not build wheels for wordcloud, which is required to install
    pycharm里无法下载,在下面下载出现问题 需要下载error里的文件https://www.lfd.uci.edu/~gohlke/pythonlibs/#wordcloud这个网站找。输入Python,看自己电脑是怎样的 下载文件后,放到对应位置,下载成功 ......
  • python 项目报错 Fatal Python error: _enter_buffered_busy: could not acquire lock
    FatalPythonerror:_enter_buffered_busy:couldnotacquirelockfor<_io.BufferedWritername=''>atinterpretershutdown,possiblyduetodaemonthreadsPythonruntimestate:finalizing(tstate=0x00005654c4008a40)Currentthread0x00007fc......
  • could not initialize proxy - no Session
    在<many-to-on>中这错误很常见,字面意义就是不能被初始化,因为session已经关闭了。简单理解就是因为,你使用了lazy=true,这样hibernate在从数据库中调数据的时候是不会把关联的对象查出来的,而是保存一个获取值得方法,在你使用getXXX()调用的时候,hiberante会利用这个保存的方法去从数据库......
  • ERROR:Could not build wheels for pycocotools, which is required to install pypro
    在创建了conda虚拟环境后,下载pycocotools包,出现这个错误,终端下载包失败,从网上直接将下载好的pycocotools包导入到,所需要环境(conda环境,本机环境)比如:anaconda\envs\py38\Lib\site-packages下面pycocotools包下载:链接:https://pan.baidu.com/s/1RsV1w0GRXJZ1rR3yPBg5FA提取码:88......
  • MySQL连接时报1040 Too many connections
    1发现问题最近使用mysql5.7的时候连接公司系统数据库时发现提示报错,出现mysqltoomanyconnection的异常。经过查询发现是mysql的系统自带的连接数太小,连接的线程超过系统配置导致出现错误。2解决过程2.1首先登录mysql终端,输入showvariableslikemax_connections,查看最大连接......
  • RuntimeError: Couldn't install gfpgan
    背景https://cloud.tencent.com/act/pro/gpu-study?from=20318tx云打折活动买来一台有V100(32G大显存)的云服务器,但是安装SD的时候由于网络原因出现各种问题:sd本身没法从github下载下来sd下载下来没法安装,也就是出现RuntimeError:Couldn'tinstallgfpgangfpgan安装后还有......
  • 解决 apt-get Could not get lock /var/lib/dpkg/lock-frontend , it is held by proc
    问题: 用lsof命令看看这几个文件是被哪个进程锁住的啊,然后先杀掉那几个进程。不杀进程,直接移除文件的话,可能仍有其他进程在操作apt的缓存,多个命令同时写apt缓存很容易发生冲突sudolsof/var/lib/dpkg/lock-frontend 杀掉进程kill-98798 ......
  • nginx 10061: No connection could be made because the target machine actively ref
    nginx10061:Noconnectioncouldbemadebecausethetargetmachineactivelyrefusedit nginx重载配置一直有些不生效,查看后,发现nginx有4个,全部关闭掉,再重开nginx,正常了nginx.exe-squit,可以把正常的nginx退出掉,其他的nginx,任务管理器强制关闭掉startnginx开启nginx,o......
  • 真机调试可以正常安装,但是不能正常运行,出现错误:couldn‘t find “libc++_shared.so“
    在迁移代码的时候,发现代码可以在模拟器上运行,但是无法在真机上面运行,最后经过挨个的排查,最终发现是ndk的问题。在app的build.gradle中的ndk缺少了匹配的实体机类型,然后加了一下'x86','armeabi-v7a','armeabi','armabi-v7a','x86_64','arm64-v8a','mips','mips64......