java.util.concurrent.ExecutionException: org.springframework.dao.IncorrectResultSizeDataAccessException: result returns more than one elements; nested exception is javax.persistence.NonUniqueResultException: result returns more than one elements

Stack Overflow | Felix | 2 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Spring Repository @Async Future<List<T>> returning wrong type

    Stack Overflow | 2 years ago | Felix
    java.util.concurrent.ExecutionException: org.springframework.dao.IncorrectResultSizeDataAccessException: result returns more than one elements; nested exception is javax.persistence.NonUniqueResultException: result returns more than one elements
  2. 0

    Game save error

    GitHub | 3 months ago | magixsource
    org.springframework.dao.IncorrectResultSizeDataAccessException: result returns more than one elements; nested exception is javax.persistence.NonUniqueResultException: result returns more than one elements

  1. tvrmsmith 1 times, last 7 months ago
6 unregistered visitors

Root Cause Analysis

  1. javax.persistence.NonUniqueResultException

    result returns more than one elements

    at org.hibernate.jpa.internal.QueryImpl.getSingleResult()
  2. org.hibernate.jpa
    CriteriaQueryTypeQueryAdapter.getSingleResult
    1. org.hibernate.jpa.internal.QueryImpl.getSingleResult(QueryImpl.java:505)
    2. org.hibernate.jpa.criteria.compile.CriteriaQueryTypeQueryAdapter.getSingleResult(CriteriaQueryTypeQueryAdapter.java:71)
    2 frames
  3. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    4. java.lang.reflect.Method.invoke(Method.java:483)
    4 frames
  4. Spring ORM
    SharedEntityManagerCreator$DeferredQueryInvocationHandler.invoke
    1. org.springframework.orm.jpa.SharedEntityManagerCreator$DeferredQueryInvocationHandler.invoke(SharedEntityManagerCreator.java:362)
    1 frame
  5. com.sun.proxy
    $Proxy74.getSingleResult
    1. com.sun.proxy.$Proxy74.getSingleResult(Unknown Source)
    1 frame
  6. Spring Data JPA
    JpaQueryExecution.execute
    1. org.springframework.data.jpa.repository.query.JpaQueryExecution$SingleEntityExecution.doExecute(JpaQueryExecution.java:197)
    2. org.springframework.data.jpa.repository.query.JpaQueryExecution.execute(JpaQueryExecution.java:74)
    2 frames