把datesource的bean的class由

org.apache.commons.dbcp2.BasicDataSource

改成

org.apache.tomcat.dbcp.dbcp.BasicDataSource
并引入相应的jar包
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-dbcp</artifactId>
<version>7.0.47</version>
</dependency>
或者是 添加
destroy-method=""
例如:
<bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="">
原因是因为连接池会自动关闭,spring又去关闭一次所以出错,将bean的关闭方法设为空即可,有红色波浪线不用管,可以直接运行。

Failed to unregister the JMX name: org.apache.commons.dbcp2:name=xxx,type=BasicDataSource的更多相关文章

  1. Dbcp2抛出org.apache.commons.dbcp2.LifetimeExceededException

    三月 24, 2016 5:16:33 下午 org.apache.commons.dbcp2.BasicDataSource onSwallowException 警告: An internal o ...

  2. 使用ThreadLocal、Apache的dbutils的QueryRunner和dbcp2数据库连接池的BasicDataSource封装操作数据库工具

    package hjp.smart4j.framework.helper; import hjp.smart4j.framework.util.CollectionUtil; import hjp.s ...

  3. MyBatis笔记----(2017年)最新的报错:Cannot find class [org.apache.commons.dbcp.BasicDataSource] for bean with name 'dataSource' defined in class path resource [com/ij34/mybatis/applicationContext.xml]; nested e

    四月 05, 2017 4:56:11 下午 org.springframework.context.support.ClassPathXmlApplicationContext prepareRef ...

  4. java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

    java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory at org.apache.commons.dbcp2.Ba ...

  5. registered the JBDC driver [oracle.jdbc.OracleDriver] but failed to unregister it when the web application was stopped. (转)

    最近项目中遇见一问题,在开发环境没有问题的代码,到了生产环境就会报如下错误:   严重: A web application registered the JBDC driver [oracle.jd ...

  6. The web application registered the JDBC driver * but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.

    最近使用了最新版的tomcat9,使用jdbc链接mysql数据库.关闭tomcat过程中出现警告 13-Sep-2017 22:22:54.369 WARNING [main] org.apache ...

  7. [tomcat启动报错]registered the JDBC driver [com.alibaba.druid.proxy.DruidDriver] but failed to unregister it when the web application was stopped

    环境:一个tomcat ,一个工程配置了多数据源,在启动的时候报如下错误: SEVERE: The web application [/qdp-resource-job] registered the ...

  8. 严重: The web application [] registered the JDBC driver [com.microsoft.sqlserver.jdbc.SQLServerDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDB

    idea项目启动报如下错误, 网上的方法都试了都没用, 一直没解决, 干掉项目, 重新从svn检出就好了...坑 啊 Root WebApplicationContext: initializatio ...

  9. registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.

    问题是tomcat的版本问题,tomcat新检测机制导致的这个问题,换版本可以解决问题,但不建议这么做,租用服务器不是你说换就换的.其实问题根源是BasicDataSource,BasicDataSo ...

随机推荐

  1. ZedGraph设置辅助线

    ZedGraph设置辅助线 1.一般来说ZedGraph设置参考线可以用 ZedGraph对象.YAxis.MajorGrid.IsVisible = True '水平参考线 ZedGraph对象.X ...

  2. ovs-appctl 命令合集

    通用命令 exit 优雅关闭ovs-vswitchd进程 qos/show interface 查询内核中关于qos的配置以及和给出端口有关的状态 cfm/show [interface]显示在指定端 ...

  3. Linux正则与文本处理工具(10)

    正则表达式 (Regular Expression, RE, 或称为常规表达式)是通过一些特殊字符的排列,用于『查找/替换/删除』一行或多行文字或字符串,简单的说,正则表达式就是用在字串的处理上面的一 ...

  4. [JavaScript] 根据指定宽度截取字符串

    /** * 根据指定宽度截取字符串 * @param desc 原始字符串 * @param width 该显示的宽度 * @param fontsize 字体大小 12px * @returns { ...

  5. centos 安装oracle 11g r2(三)-----表空间创建

    centos 安装oracle 11g r2(三)-----表空间创建 创建表空间前要保证监听与数据库实例已经启动 1.启动监听 [oracle@localhost ~]$ lsnrctl start ...

  6. Python--CSV模块

    CSV csv文件格式是一种通用的电子表格和数据库导入导出格式 简介 Python csv模块封装了常用的功能,使用的简单例子如下: 写入 # 写入csv文件 import csv csvfile = ...

  7. 5_Python OOP

    1. 实例属性和类属性        (1) 实例属性在构造函数__init__中定义,定义时以self作为前缀,只能通过实例名访问        (2) 类属性在类中方法之外单独定义,还可以在程序中 ...

  8. EXECUTE 后的事务计数指示缺少了 COMMIT 或 ROLLBACK TRANSACTION 语句。上一计数 = 1,当前计数 = 2

    理解这一句话: 一个begin tran会增加一个事务计数器,要有相同数量的commit与之对应,而rollback可以回滚全部计数器 这个错误一般是出现在嵌套事务中. 测试环境 sql 2008 例 ...

  9. Vim实用技巧系列 - 利用百度云和git实现vim配置多机共享

    Vim是一个强大的文本编辑器.良好的配置更能便利对Vim的使用.有时候,我们会在几台不同的电脑上使用Vim. 例如,我们可能在自己的电脑和公司的电脑上都安装了Vim. 有时候,我们需要实现,如果我们配 ...

  10. 剑指offer五之用两个栈实现队列

    一.题目 用两个栈来实现一个队列,完成队列的Push和Pop操作. 队列中的元素为int类型. 二.思路 1.Push操作:将数据直接压入stack1即可 2.Pop操作:将stack1中的数据全部弹 ...