org.apache.ibatis.exceptions.TooManyResultsException

Expected one result (or null) to be returned by selectOne(), but found: 2

Solutions on the web27

  • via alfresco.com by Unknown author, 1 year ago
    Expected one result (or null) to be returned by selectOne(), but found: 2
  • via Google Groups by Ingo Richtsmeier, 3 weeks ago
    Expected one result (or null) to be returned by selectOne(), but found: 2
  • via Stack Overflow by AmitP
    , 1 year ago
    Expected one result (or null) to be returned by selectOne(), but found: 2
  • Stack trace

    • 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:70)[mybatis-3.2.7.jar:3.2.7] at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:68)[mybatis-3.2.7.jar:3.2.7] at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:52)[mybatis-3.2.7.jar:3.2.7] at com.sun.proxy.$Proxy86.selectByKey(Unknown Source)[na:na] at org.sonar.server.component.db.ComponentDao.doGetNullableByKey(ComponentDao.java:145)[sonar-server-5.1.2.jar:na] at org.sonar.server.component.db.ComponentDao.doGetNullableByKey(ComponentDao.java:47)[sonar-server-5.1.2.jar:na] at org.sonar.server.db.BaseDao.getNullableByKey(BaseDao.java:158)[sonar-server-5.1.2.jar:na] at org.sonar.server.batch.ProjectRepositoryLoader.load(ProjectRepositoryLoader.java:91)[sonar-server-5.1.2.jar:na] at org.sonar.server.batch.ProjectRepositoryAction.handle(ProjectRepositoryAction.java:70)[sonar-server-5.1.2.jar:na] at org.sonar.server.ws.WebServiceEngine.execute(WebServiceEngine.java:84)[sonar-server-5.1.2.jar:na] at sun.reflect.GeneratedMethodAccessor201.invoke(Unknown Source)[na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.8.0_74] at java.lang.reflect.Method.invoke(Method.java:498)[na:1.8.0_74] at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:425)[jruby-complete-1.7.9.jar:na] at org.jruby.javasupport.JavaMethod.invokeDirect(JavaMethod.java:292)[jruby-complete-1.7.9.jar:na] at org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:44)[jruby-complete-1.7.9.jar:na] at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:70)[jruby-complete-1.7.9.jar:na]

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Unknown user
    Once, 1 year ago
    Unknown user
    Once, 10 months ago
    Unknown user
    Once, 1 year ago
    Unknown user
    Once, 2 years ago