使用mybatis-3.2.2.jar + mybatis-spring-1.2.0.jar集成时,报以下异常: 15:42:48.538 [Thread-1] DEBUG o.s.b.f.s.DisposableBeanAdapter - Invoking destroy method 'close' on bean with name 'sqlSession' 15:42:48.586 [Thread-1] WARN o.s.b.f.s.DisposableBeanAdapter - Inv…
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.re…
背景: 今天启动一个老项目,控制台打印出以下异常,大概是说在Spring托管的SqlSession上不允许手动关闭: java.lang.UnsupportedOperationException: Manual close is not allowed over a Spring managed SqlSession at org.mybatis.spring.SqlSessionTemplate.close(SqlSessionTemplate.java:359) at sun.reflec…
最近用junit测试spring项目的时候,报错: Manual close is not allowed over a Spring managed SqlSession 意思是不允许手动关闭spring管理的sqlSessinon, google了半天,最后搞定了,是mybatis和mybatis版本的问题: https://github.com/mybatis/spring-boot-starter/commit/990b3e3b123af87303fe6a588a0ddd6a36178b…
在用Spring 和mybatis整合的 写测试类的时候报出解决办法:在全局配置文件   class="org.mybatis.spring.SqlSessionTemplate" 后面加  scope="prototype" spring 默认scope 是单例模式这样只会创建一个Action对象每次访问都是同一个Action对象,数据不安全struts2 是要求 每次次访问 都对应不同的Actionscope="prototype" 可以保证…
最近使用Android Studio开发一个新项目,刚做完几个界面,跑在android 5.0上面很正常,因为都是挺简单的布局,本以为应该不存在兼容性问题(Flag啊). 偶然用了一个4.x的实机测试,发现杯具了,直接报错退出了,发现log里面打出这么一句: java.lang.UnsupportedOperationException: Can't convert to color: type=0x2 难以理解啊,没办法一步一步调试吧. 顺便说一下调试要注意的问题,如果compileSdkVe…
场景: SpringMVC+Hibernate+Maven 问题: 在src/main/resources 目录中添加hibernate.properties文件, 则如果存在这句hibernate.hbm2ddl.auto=update 启动tomcat就报如下异常, 去掉启动不报错,访问servlet的时候报错,去掉文件中所有属性,访问也不报错 hibernate.properties 文件内容:hibernate.connection.driver_class=com.mysql.jdbc…
对Arrays.asList()返回的List进行操作之后报错Caused by: java.lang.UnsupportedOperationException 让我们来看一下Arrays.asList的源码: /** * Returns a {@code List} of the objects in the specified array. The size of the * {@code List} cannot be modified, i.e. adding and removing…
mybatis抛出下面的异常: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: java.lang.UnsupportedOperationException ### The error may exist in file [C:\apache-t…
在项目中采用一个枚举的集合,本人采用Collections中的空集合Collections.emptyList()在添加时发生异常: 常见集合如下: private List<VacationCategory> vacationcategorys = Collections.emptyList(); 报错误如下: -- Encapsulated exception ------------\java.lang.UnsupportedOperationException at java.util…