java.lang.IllegalArgumentException: expected one element but was: <null, null, null, null, null, ...>

Sonatype JIRA | Benjamin Bentmann | 1 month ago
tip
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

    https://github.com/sonatype/nexus-internal/blob/c341bcc9311c122cc17d51df0abb30920b2fe33f/components/nexus-repository/src/main/java/org/sonatype/nexus/repository/storage/OrientAsyncHelper.java#L184 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 org.sonatype.nexus.extdirect.internal.ExtDirectServlet - Failed to invoke action method: coreui_Component.read, java-method: org.sonatype.nexus.coreui.ComponentComponent.read java.lang.IllegalArgumentException: expected one element but was: <null, null, null, null, null, ...> at com.google.common.collect.Iterators.getOnlyElement(Iterators.java:322) [com.google.guava:20.0.0] at com.google.common.collect.Iterables.getOnlyElement(Iterables.java:294) [com.google.guava:20.0.0] at org.sonatype.nexus.repository.browse.internal.BrowseServiceImpl.getCount(BrowseServiceImpl.java:192) [na:na] at org.sonatype.nexus.repository.browse.internal.BrowseServiceImpl.browseComponents(BrowseServiceImpl.java:95) [na:na] at org.sonatype.nexus.repository.browse.BrowseService$browseComponents.call(Unknown Source) [na:na] at org.sonatype.nexus.coreui.ComponentComponent.read(ComponentComponent.groovy:126) [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 org.sonatype.nexus.repository.storage.OrientAsyncHelper$QueueConsumingIterable.next(OrientAsyncHelper.java:202) [na:na] at org.sonatype.nexus.repository.storage.OrientAsyncHelper$QueueConsumingIterable.next(OrientAsyncHelper.java:1) [na:na] at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:47) [com.google.guava:20.0.0] at org.sonatype.nexus.repository.maven.internal.PurgeUnusedSnapshotsFacetImpl.deleteUnusedSnapshotComponents(PurgeUnusedSnapshotsFacetImpl.java:165) [na:na] {noformat}

    Sonatype JIRA | 1 month ago | Benjamin Bentmann
    java.lang.IllegalArgumentException: expected one element but was: <null, null, null, null, null, ...>
  2. 0

    I've set up nexus 3.1.0-04 and set up update path from 2.14.1-01 version update finished successfully, mvn repo (~ 300 Gb size) was synched with hardlink method I am able to deploy artifact to synced repo in nexus 3 Bug when browing repo via "Assets" or "Components", screen hangs and error appears in log: 2016-12-23 18:47:26,654+0300 ERROR [qtp933518986-205] *UNKNOWN org.sonatype.nexus.extdirect.internal.ExtDirectServlet - Failed to invoke action method: coreui_Component.read, java-method: org.sonatype.nexus.coreui.ComponentComponent.read java.lang.IllegalArgumentException: expected one element but was: <null, #-2:0{COUNT:0} v0> at com.google.common.collect.Iterators.getOnlyElement(Iterators.java:317) [com.google.guava:18.0.0] at com.google.common.collect.Iterables.getOnlyElement(Iterables.java:289) [com.google.guava:18.0.0] at org.sonatype.nexus.repository.browse.internal.BrowseServiceImpl.getCount(BrowseServiceImpl.java:204) [na:na] at org.sonatype.nexus.repository.browse.internal.BrowseServiceImpl.browseComponents(BrowseServiceImpl.java:99) [na:na] at org.sonatype.nexus.repository.browse.BrowseService$browseComponents.call(Unknown Source) [na:na] at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) [na:na] at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) [na:na] at org.sonatype.nexus.coreui.ComponentComponent.read(ComponentComponent.groovy:126) [na:na] at com.palominolabs.metrics.guice.ExceptionMeteredInterceptor.invoke(ExceptionMeteredInterceptor.java:49) [na:na] at com.palominolabs.metrics.guice.TimedInterceptor.invoke(TimedInterceptor.java:47) [na:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [na:1.8.0_111] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [na:1.8.0_111] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [na:1.8.0_111] at java.lang.reflect.Method.invoke(Method.java:498) [na:1.8.0_111] at com.softwarementors.extjs.djn.router.dispatcher.DispatcherBase.invokeJavaMethod(DispatcherBase.java:142) [org.sonatype.nexus.extdirect:3.1.0.04] at com.softwarementors.extjs.djn.router.dispatcher.DispatcherBase.invokeMethod(DispatcherBase.java:133) [org.sonatype.nexus.extdirect:3.1.0.04] at org.sonatype.nexus.extdirect.internal.ExtDirectServlet$3.invokeMethod(ExtDirectServlet.java:221) [org.sonatype.nexus.extdirect:3.1.0.04] at com.softwarementors.extjs.djn.router.dispatcher.DispatcherBase.dispatch(DispatcherBase.java:63) [org.sonatype.nexus.extdirect:3.1.0.04] at com.softwarementors.extjs.djn.router.processor.standard.StandardRequestProcessorBase.dispatchStandardMethod(StandardRequestProcessorBase.java:73) [org.sonatype.nexus.extdirect:3.1.0.04] at com.softwarementors.extjs.djn.router.processor.standard.json.JsonRequestProcessor.processIndividualRequest(JsonRequestProcessor.java:502) [org.sonatype.nexus.extdirect:3.1.0.04] at com.softwarementors.extjs.djn.router.processor.standard.json.JsonRequestProcessor.processIndividualRequestsInThisThread(JsonRequestProcessor.java:150) [org.sonatype.nexus.extdirect:3.1.0.04] at com.softwarementors.extjs.djn.router.processor.standard.json.JsonRequestProcessor.process(JsonRequestProcessor.java:133) [org.sonatype.nexus.extdirect:3.1.0.04] at com.softwarementors.extjs.djn.router.RequestRouter.processJsonRequest(RequestRouter.java:83) [org.sonatype.nexus.extdirect:3.1.0.04] at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.processRequest(DirectJNgineServlet.java:617) [org.sonatype.nexus.extdirect:3.1.0.04] at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.doPost(DirectJNgineServlet.java:580) [org.sonatype.nexus.extdirect:3.1.0.04] at org.sonatype.nexus.extdirect.internal.ExtDirectServlet.doPost(ExtDirectServlet.java:127) [org.sonatype.nexus.extdirect:3.1.0.04] at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) [javax.servlet-api:3.1.0] at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [javax.servlet-api:3.1.0]

    Sonatype JIRA | 2 months ago | Ilya Martynov
    java.lang.IllegalArgumentException: expected one element but was: <null, #-2:0{COUNT:0} v0>
  3. 0

    If you click on the very first (unlabeled) column of the component browser you'll get an illegal argument exception. The component browser is unusable after doing this until you sort by another column. {noformat} 2016-11-11 15:19:58,220+0100 ERROR [qtp1389586213-3438] chuck org.sonatype.nexus.extdirect.internal.ExtDirectServlet - Failed to invoke action method: coreui_Component.read, java-method: org.sonatype.nexus.coreui.ComponentComponent.read java.lang.IllegalArgumentException: null at com.google.common.base.Preconditions.checkArgument(Preconditions.java:108) [com.google.guava:18.0.0] at org.sonatype.nexus.repository.browse.internal.QueryOptions.<init>(QueryOptions.java:55) [na:na] at org.sonatype.nexus.repository.browse.internal.BrowseServiceImpl.browseComponents(BrowseServiceImpl.java:95) [na:na] at org.sonatype.nexus.repository.browse.BrowseService$browseComponents.call(Unknown Source) [na:na] at org.sonatype.nexus.coreui.ComponentComponent.read(ComponentComponent.groovy:126) [na:na] at com.palominolabs.metrics.guice.ExceptionMeteredInterceptor.invoke(ExceptionMeteredInterceptor.java:49) [na:na] at com.palominolabs.metrics.guice.TimedInterceptor.invoke(TimedInterceptor.java:47) [na:na] at sun.reflect.GeneratedMethodAccessor703.invoke(Unknown Source) [na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [na:1.8.0_102] at java.lang.reflect.Method.invoke(Method.java:498) [na:1.8.0_102] at com.softwarementors.extjs.djn.router.dispatcher.DispatcherBase.invokeJavaMethod(DispatcherBase.java:142) [org.sonatype.nexus.extdirect:3.1.0.04] at com.softwarementors.extjs.djn.router.dispatcher.DispatcherBase.invokeMethod(DispatcherBase.java:133) [org.sonatype.nexus.extdirect:3.1.0.04] at org.sonatype.nexus.extdirect.internal.ExtDirectServlet$3.invokeMethod(ExtDirectServlet.java:221) [org.sonatype.nexus.extdirect:3.1.0.04] at com.softwarementors.extjs.djn.router.dispatcher.DispatcherBase.dispatch(DispatcherBase.java:63) [org.sonatype.nexus.extdirect:3.1.0.04] at com.softwarementors.extjs.djn.router.processor.standard.StandardRequestProcessorBase.dispatchStandardMethod(StandardRequestProcessorBase.java:73) [org.sonatype.nexus.extdirect:3.1.0.04] at com.softwarementors.extjs.djn.router.processor.standard.json.JsonRequestProcessor.processIndividualRequest(JsonRequestProcessor.java:502) [org.sonatype.nexus.extdirect:3.1.0.04] at com.softwarementors.extjs.djn.router.processor.standard.json.JsonRequestProcessor.processIndividualRequestsInThisThread(JsonRequestProcessor.java:150) [org.sonatype.nexus.extdirect:3.1.0.04] at com.softwarementors.extjs.djn.router.processor.standard.json.JsonRequestProcessor.process(JsonRequestProcessor.java:133) [org.sonatype.nexus.extdirect:3.1.0.04] at com.softwarementors.extjs.djn.router.RequestRouter.processJsonRequest(RequestRouter.java:83) [org.sonatype.nexus.extdirect:3.1.0.04] at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.processRequest(DirectJNgineServlet.java:617) [org.sonatype.nexus.extdirect:3.1.0.04] at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.doPost(DirectJNgineServlet.java:580) [org.sonatype {noformat}

    Sonatype JIRA | 3 months ago | Rich Seddon
    java.lang.IllegalArgumentException: null
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 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.
  6. 0
    samebug tip
    Upgrade your old nexus to 2.14.1-01
    via Sonatype JIRA by Marc Lévi

    1 unregistered visitors
    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.lang.IllegalArgumentException

      expected one element but was: <null, null, null, null, null, ...>

      at com.google.common.collect.Iterators.getOnlyElement()
    2. Guava
      Iterables.getOnlyElement
      1. com.google.common.collect.Iterators.getOnlyElement(Iterators.java:322)[com.google.guava:20.0.0]
      2. com.google.common.collect.Iterables.getOnlyElement(Iterables.java:294)[com.google.guava:20.0.0]
      2 frames
    3. org.sonatype.nexus
      ComponentComponent.read
      1. org.sonatype.nexus.repository.browse.internal.BrowseServiceImpl.getCount(BrowseServiceImpl.java:192)[na:na]
      2. org.sonatype.nexus.repository.browse.internal.BrowseServiceImpl.browseComponents(BrowseServiceImpl.java:95)[na:na]
      3. org.sonatype.nexus.repository.browse.BrowseService$browseComponents.call(Unknown Source)[na:na]
      4. org.sonatype.nexus.coreui.ComponentComponent.read(ComponentComponent.groovy:126)[na:na]
      4 frames