-
大白 小试身手Lv3
发表于2019-9-12 10:58
楼主
报错信息类似:
系统小憩片刻...
Expected one result (or null) to be returned by selectOne(), but found: 2
收起详情
Expected one result (or null) to be returned by selectOne(), but found: 2客户端环境:(Other) Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36客户端地址:https://imoc.huawei.com/eSeeBI/esmain/index.do服务器版本:V4.7.1_HWR241-build20190705161207-r44cad2e
org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 2
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:63)
at sun.reflect.GeneratedMethodAccessor39.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.ibatis.session.SqlSessionManager$SqlSessionInterceptor.invoke(SqlSessionManager.java:282)
at com.sun.proxy.$Proxy20.selectOne(Unknown Source)
at org.apache.ibatis.session.SqlSessionManager.selectOne(SqlSessionManager.java:151)
at com.esen.vfs2.VfsNodeOperDB.getNode(VfsNodeOperDB.java:192)
at com.esen.vfs2.impl.VfsFile2Impl.initNode(VfsFile2Impl.java:112)
at com.esen.vfs2.impl.VfsFile2Impl._initNode(VfsFile2Impl.java:89)
解决方案:
1、该报错为系统中资源管理器对应数据库表es10_vfs存在重复记录导致
select * from ( select parentdir_, filename_, count(*) as cnt from es10_vfs group by parentdir_, filename_ ) t where t.cnt>1 order by cnt desc
2、如果存在,执行如下查看全部重复记录清单:
select * from es10_vfs where (parentdir_,filename_) in
(select parentdir_,filename_ from ( select parentdir_, filename_, count(*) as cnt from es10_vfs group by parentdir_, filename_ ) t where t.cnt>1)
3、然后将重复记录删除,只保留唯一一条记录即可。
系统小憩片刻...
Expected one result (or null) to be returned by selectOne(), but found: 2
收起详情
Expected one result (or null) to be returned by selectOne(), but found: 2客户端环境:(Other) Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36客户端地址:https://imoc.huawei.com/eSeeBI/esmain/index.do服务器版本:V4.7.1_HWR241-build20190705161207-r44cad2e
org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 2
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:63)
at sun.reflect.GeneratedMethodAccessor39.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.ibatis.session.SqlSessionManager$SqlSessionInterceptor.invoke(SqlSessionManager.java:282)
at com.sun.proxy.$Proxy20.selectOne(Unknown Source)
at org.apache.ibatis.session.SqlSessionManager.selectOne(SqlSessionManager.java:151)
at com.esen.vfs2.VfsNodeOperDB.getNode(VfsNodeOperDB.java:192)
at com.esen.vfs2.impl.VfsFile2Impl.initNode(VfsFile2Impl.java:112)
at com.esen.vfs2.impl.VfsFile2Impl._initNode(VfsFile2Impl.java:89)
解决方案:
1、该报错为系统中资源管理器对应数据库表es10_vfs存在重复记录导致
select * from ( select parentdir_, filename_, count(*) as cnt from es10_vfs group by parentdir_, filename_ ) t where t.cnt>1 order by cnt desc
2、如果存在,执行如下查看全部重复记录清单:
select * from es10_vfs where (parentdir_,filename_) in
(select parentdir_,filename_ from ( select parentdir_, filename_, count(*) as cnt from es10_vfs group by parentdir_, filename_ ) t where t.cnt>1)
3、然后将重复记录删除,只保留唯一一条记录即可。