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

Connections could not be acquired from the underlying database!

时间:2023-05-20 10:02:56浏览次数:49  
标签: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://blog.51cto.com/u_10632206/6317179

相关文章

  • github报错“ssh_exchange_identification: Connection closed by remote host fatal:
    解决方式:不确定是否为密钥过期还是C:\Users\John\.ssh文件夹下的config文件中没有添加github的host。总之,所有的尝试如下:(1)重新生成公钥和私钥。打开gitbash,输入以下命令获取自己github的email。gitconfiguser.email 生成ssh私钥和公钥ssh-keygen-trsa-......
  • Connections could not be acquired from the underlying database!
    报错内容:五月19,20239:02:42上午org.apache.catalina.core.StandardWrapperValveinvoke严重:在路径为的上下文中,Servlet[springmvc]的Servlet.service()引发了具有根本原因的异常Requestprocessingfailed;nestedexceptionisorg.springframework.transaction.CannotCre......
  • 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 ......