java.util.NoSuchElementException: Iterator depleted

Sonatype JIRA | Benjamin Bentmann | 3 months ago
Do you find the tips below useful? Click on the to mark them and say thanks to rafafviola and rp . Or join the community to write better ones.
  1. 0 The {{queue.poll()}} invocation there yields no exception but {{null}} when the timeout elapses. This causes the following issues: # {{hasNext()}} returning {{true}} when in reality no element is available # {{next()}} returning a non-deterministic number of {{null}} elements tripping up processing of the query results, e.g. {noformat} 2017-01-10 15:09:20,084+0100 ERROR [qtp172586730-295] admin - Failed to invoke action method:, java-method: java.lang.IllegalArgumentException: expected one element but was: <null, null, null, null, null, ...> at [] at [] at [na:na] at [na:na] at$ Source) [na:na] at [na:na] {noformat} # {{next()}} failing with {{NoSuchElementException}} although the caller previously checked {{hasNext() == true}} ({{next()}} calls {{hasNext()}} again and can observe a different value than the caller, like the end-of-query sentinel), e.g. {noformat} Suppressed: java.util.NoSuchElementException: Iterator depleted at$ [na:na] at$ [na:na] at [] at [na:na] {noformat}

    Sonatype JIRA | 3 months ago | Benjamin Bentmann
    java.util.NoSuchElementException: Iterator depleted
  2. 0
    samebug tip
    Try looking for variables that have been declared but not created as an object on the functions described in the stack trace.
  3. 0
    samebug tip
    Upgrade your old nexus to 2.14.1-01
    via Sonatype JIRA by Marc Lévi
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    The Maven facet attempts to fill in information about a pom using the {{MavenModels.readModel}} function. If the supplied input stream is empty, this throws an exception and causes issues upstream when we (for example) attempt to migrate a zero-length pom or deploy one to a hosted repository (see stack trace of resulting HTTP 500 error below). The javadoc for the method in question says that it should "return \{@code null\} if input not parsable". It seems more consistent to return null when the input stream is empty instead of throwing an EOFException, but what would that cause unintended side-effects? For reference, NX2 does not reject deployments of empty POMs. {noformat} 2017-02-08 19:25:17,516+0100 WARN [qtp571182704-310] admin - Service failure input contained no data at org.codehaus.plexus.util.xml.pull.MXParser.fillBuf( [na:na] at org.codehaus.plexus.util.xml.pull.MXParser.more( [na:na] at org.codehaus.plexus.util.xml.pull.MXParser.parseProlog( [na:na] at org.codehaus.plexus.util.xml.pull.MXParser.nextImpl( [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] {noformat}

    Sonatype JIRA | 2 months ago | Eric Cobb input contained no data
  6. 0

    If a user has read privileges to a npm group, but not the underlying npm proxy, then the "npm install <package>" will get a 500 response for any package that is not locally cached in the npm proxy. Steps to reproduce: 1) Setup a npm group _npm-all_ that has npm proxy _npmjs_ as a member 2) Setup a user that has access to group repo _npm-all_ (privilege nx-repository-view-npm-npm-all). 3) Try to install a npm package that is not locally cached in proxy _npmjs_ The npm install command will fail with something like the following: {noformat} npm http fetch GET http://localhost:8081/repository/npm-all/glob/-/glob-7.1.1.tgz npm http fetch 500 http://localhost:8081/repository/npm-all/glob/-/glob-7.1.1.tgz npm info retry will retry, error on last attempt: Error: server error 500 {noformat} Nexus logs will show the following: {noformat} 2016-12-21 11:21:38,899+0000 WARN [qtp1898010376-415] test - Service failure java.lang.RuntimeException: org.apache.shiro.authz.AuthorizationException at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at$ Source) [na:na] at$_closure1.doCall(NpmProxyRecipe.groovy:160) [na:na] ... ... Caused by: org.apache.shiro.authz.AuthorizationException at [na:na] at [na:na] at [na:na] ... 131 common frames omitted Caused by: org.apache.shiro.authz.AuthorizationException: null at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] at [na:na] ... 133 common frames omitted {noformat} *Workaround* If you give that user a read privilege to the proxy _npmjs_ (nx-repository-view-npm-npmjs-read) then the user should be able to install the package that is not already cached. Group level permissions should be transitive, therefore use has the same privileges for all member repositories.

    Sonatype JIRA | 4 months ago | Mahendra Surani
    java.lang.RuntimeException: org.apache.shiro.authz.AuthorizationException

    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

      Iterator depleted

      2 frames
    3. Guava
      1 frame
      1 frame