java.lang.UnsupportedOperationException: Manual close is not allowed over a Spring managed SqlSession
at org.mybatis.spring.SqlSessionTemplate.close(SqlSessionTemplate.java:310)
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)
at org.springframework.beans.factory.support.DisposableBeanAdapter.invokeCustomDestroyMethod(DisposableBeanAdapter.java:364)
at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:287)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:578)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:554)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:954)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:523)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:961)
at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1033)
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1009)
at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:961)
at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:581)
at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:116)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4774)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5411)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:226)
at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1420)
at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1409)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

在配置里面加上

<bean id="sqlSessionTemplate2" class="org.mybatis.spring.SqlSessionTemplate" scope="prototype">
<constructor-arg ref="sqlSessionFactory2" />
</bean>

  在sqlSessionTemplate 加上  scope="prototype"

java.lang.UnsupportedOperationException: Manual close is not allowed over a Spring managed SqlSession的更多相关文章

  1. 异常:java.lang.UnsupportedOperationException: Manual close is not allowed over a Spring managed SqlSession

    使用mybatis-3.2.2.jar + mybatis-spring-1.2.0.jar集成时,报以下异常: 15:42:48.538 [Thread-1] DEBUG o.s.b.f.s.Dis ...

  2. 异常处理 | manual close is not allowed over a Spring managed SqlSession

    背景: 今天启动一个老项目,控制台打印出以下异常,大概是说在Spring托管的SqlSession上不允许手动关闭: java.lang.UnsupportedOperationException: ...

  3. Manual close is not allowed over a Spring managed SqlSession(转)

    最近用junit测试spring项目的时候,报错: Manual close is not allowed over a Spring managed SqlSession 意思是不允许手动关闭spr ...

  4. 测试类异常Manual close is not allowed over a Spring managed SqlSession

    在用Spring 和mybatis整合的 写测试类的时候报出解决办法:在全局配置文件   class="org.mybatis.spring.SqlSessionTemplate" ...

  5. java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x12

    最近使用Android Studio开发一个新项目,刚做完几个界面,跑在android 5.0上面很正常,因为都是挺简单的布局,本以为应该不存在兼容性问题(Flag啊). 偶然用了一个4.x的实机测试 ...

  6. java.lang.UnsupportedOperationException: Not supported by BasicDataSource

    场景: SpringMVC+Hibernate+Maven 问题: 在src/main/resources 目录中添加hibernate.properties文件, 则如果存在这句hibernate. ...

  7. Caused by: java.lang.UnsupportedOperationException

    对Arrays.asList()返回的List进行操作之后报错Caused by: java.lang.UnsupportedOperationException 让我们来看一下Arrays.asLi ...

  8. mybatis java.lang.UnsupportedOperationException

    mybatis抛出下面的异常: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exc ...

  9. java 异常java.lang.UnsupportedOperationException

    在项目中采用一个枚举的集合,本人采用Collections中的空集合Collections.emptyList()在添加时发生异常: 常见集合如下: private List<VacationC ...

随机推荐

  1. vue-learning:37 - router - 目录

    vue路由vue-router 目录 前端路由历史 服务端渲染(SSR:server side render) 客户端路由(client side routing) 前端路由实现原理 hash模式: ...

  2. java打包上传服务器的一些命令

    Maven下package打包成jar包和war包,都在target目录下 其中War包扔在tomcat的webapps目录下.随tomcat启动自行启动 运行jar包命令. nohup java - ...

  3. ZOJ Problem Set - 1090——The Circumference of the Circle

      ZOJ Problem Set - 1090 The Circumference of the Circle Time Limit: 2 Seconds      Memory Limit: 65 ...

  4. 【Docker】企业级镜像仓库harbor的搭建(http/https)及使用

    一:用途 Harbor是一个用于存储和分发Docker镜像的企业级Registry服务器. 二:安装docker-ce 环境:阿里云轻量应用服务器CentOS 7.3 这里通过yum Docker源仓 ...

  5. javaweb项目添加log4j日志

    谈到我们在Java程序中经常用的日志,Log4j应该是耳熟能详了.这里先提下slf4j,英文全名是Simple Logging Facade for Java,直面意思是:Java的简单日志门面.sl ...

  6. docker.service 修改指南

    vi /lib/systemd/system/docker.service docker.service默认内容如下: [Unit] Description=Docker Application Co ...

  7. CPP 设计模式学习

    源地址 https://www.ev0l.art/index.php/archives/20/ 备忘录模式 在一个类内部记录另一个类的快照状态的模式.可以再合适的时候跳回复用 设计备忘录的三大步骤: ...

  8. js获取当前农历时间

    <template> <div class="gaia-header"> <img alt="gaia_logo" src=&qu ...

  9. ScheduledThreadPoolExecutor中定时周期任务的实现源码分析

    ScheduledThreadPoolExecutor是一个定时任务线程池,相比于ThreadPoolExecutor最大的不同在于其阻塞队列的实现 首先看一下其构造方法: public Schedu ...

  10. npm安装报错npm ERR! Refusing to install package with name "xxxx" under a packagexxxx

    npm ERR! code ENOSELF npm ERR! Refusing to install package with name "webpack" under a pac ...