java.util.NoSuchElementException: More than one element in IteratorWrapper(non-empty iterator). First element is '{layer=Node[5]}' and the second element is '{layer=Node[6]}'

Spring JIRA | Timothy Reaves | 4 years ago
  1. 0

    I have a very simple repository (extends GraphRepository) with this method: Layer findLayerByNameAndOem(String name, String oem); My understanding is this should find the layer where both name and oem match. This fails. It finds all Layer instances with the same name. Both fields are @Indexed. My test is this: @Test @Transactional public void findLayerByNameAndOem_returnsSingleResult() { repository.save(new Layer("development1", "SUXX")); repository.save(new Layer("development2", "SUXX")); Layer retrievedLayer = repository.findLayerByNameAndOem("development1", "SUXX"); assertNotNull(retrievedLayer); assertEquals("retrieved illustration fileName matches", "development", retrievedLayer.getName()); assertEquals("retrieved illustration name matches", "SUXX", retrievedLayer.getOem()); } and the stack trace is: java.util.NoSuchElementException: More than one element in IteratorWrapper(non-empty iterator). First element is '{layer=Node[5]}' and the second element is '{layer=Node[6]}' at org.neo4j.helpers.collection.IteratorUtil.singleOrNull(IteratorUtil.java:118) at org.neo4j.helpers.collection.IteratorUtil.singleOrNull(IteratorUtil.java:260) at org.springframework.data.neo4j.conversion.QueryResultBuilder$1.singleOrNull(QueryResultBuilder.java:94) at org.springframework.data.neo4j.repository.query.GraphRepositoryQuery.dispatchQuery(GraphRepositoryQuery.java:96) ...

    Spring JIRA | 4 years ago | Timothy Reaves
    java.util.NoSuchElementException: More than one element in IteratorWrapper(non-empty iterator). First element is '{layer=Node[5]}' and the second element is '{layer=Node[6]}'
  2. 0

    I have a very simple repository (extends GraphRepository) with this method: Layer findLayerByNameAndOem(String name, String oem); My understanding is this should find the layer where both name and oem match. This fails. It finds all Layer instances with the same name. Both fields are @Indexed. My test is this: @Test @Transactional public void findLayerByNameAndOem_returnsSingleResult() { repository.save(new Layer("development1", "SUXX")); repository.save(new Layer("development2", "SUXX")); Layer retrievedLayer = repository.findLayerByNameAndOem("development1", "SUXX"); assertNotNull(retrievedLayer); assertEquals("retrieved illustration fileName matches", "development", retrievedLayer.getName()); assertEquals("retrieved illustration name matches", "SUXX", retrievedLayer.getOem()); } and the stack trace is: java.util.NoSuchElementException: More than one element in IteratorWrapper(non-empty iterator). First element is '{layer=Node[5]}' and the second element is '{layer=Node[6]}' at org.neo4j.helpers.collection.IteratorUtil.singleOrNull(IteratorUtil.java:118) at org.neo4j.helpers.collection.IteratorUtil.singleOrNull(IteratorUtil.java:260) at org.springframework.data.neo4j.conversion.QueryResultBuilder$1.singleOrNull(QueryResultBuilder.java:94) at org.springframework.data.neo4j.repository.query.GraphRepositoryQuery.dispatchQuery(GraphRepositoryQuery.java:96) ...

    Spring JIRA | 4 years ago | Timothy Reaves
    java.util.NoSuchElementException: More than one element in IteratorWrapper(non-empty iterator). First element is '{layer=Node[5]}' and the second element is '{layer=Node[6]}'
  3. 0

    Problem during importing relations with auto indexing

    GitHub | 3 years ago | mkleszcz
    java.util.NoSuchElementException: More than one element in org.mapdb.Bind$5$1@1a0225b. First element is '1' and the second element is '2'
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    find-or-create vs. multi-threading with Neo4j

    Stack Overflow | 3 years ago | Michael K├Ânig
    java.util.NoSuchElementException: More than one element in org.neo4j.cypher.PipeExecutionResult$$anon$1@8f0dc23. First element is '{pair=Node[20001]}' and the second element is '{pair=Node[20000]}'
  6. 0

    Unable to load the same OSM data in two different layers.

    GitHub | 5 years ago | svzdvd
    java.util.NoSuchElementException: More than one element in org.neo4j.index.impl.lucene.LuceneIndex$1@7b7d1256. First element is 'Node[14]' and the second element is 'Node[2042]'

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.util.NoSuchElementException

      More than one element in IteratorWrapper(non-empty iterator). First element is '{layer=Node[5]}' and the second element is '{layer=Node[6]}'

      at org.neo4j.helpers.collection.IteratorUtil.singleOrNull()
    2. Neo4j - Graph Database Kernel
      IteratorUtil.singleOrNull
      1. org.neo4j.helpers.collection.IteratorUtil.singleOrNull(IteratorUtil.java:118)
      2. org.neo4j.helpers.collection.IteratorUtil.singleOrNull(IteratorUtil.java:260)
      2 frames
    3. Spring Data Neo4j
      GraphRepositoryQuery.dispatchQuery
      1. org.springframework.data.neo4j.conversion.QueryResultBuilder$1.singleOrNull(QueryResultBuilder.java:94)
      2. org.springframework.data.neo4j.repository.query.GraphRepositoryQuery.dispatchQuery(GraphRepositoryQuery.java:96)
      2 frames