java.lang.IllegalArgumentException: No more parsing elements.

Java.net JIRA | flopma | 4 years ago
  1. 0

    Hi, I'm trying to unmarshall a REST response I get from a Jira instance v5.1.6. REST format is always JSON from this version of JIRA. The error I get is a {code} java.lang.IllegalArgumentException: No more parsing elements. at com.sun.jersey.json.impl.reader.JsonXmlStreamReader.next(JsonXmlStreamReader.java:503) ~[jersey-json-1.14.jar:1.14] at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:197) ~[jaxb-impl-2.2.3-1.jar:2.2.3] at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:366) ~[jaxb-impl-2.2.3-1.jar:2.2.3] at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:345) ~[jaxb-impl-2.2.3-1.jar:2.2.3] at com.sun.jersey.json.impl.BaseJSONUnmarshaller.unmarshalJAXBElementFromJSON(BaseJSONUnmarshaller.java:111) ~[jersey-json-1.14.jar:1.14] at com.sun.jersey.json.impl.BaseJSONUnmarshaller.unmarshalFromJSON(BaseJSONUnmarshaller.java:100) ~[jersey-json-1.14.jar:1.14] at com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider.readFrom(JSONRootElementProvider.java:129) ~[jersey-json-1.14.jar:1.14] at com.sun.jersey.core.provider.jaxb.AbstractRootElementProvider.readFrom(AbstractRootElementProvider.java:111) ~[jersey-core-1.14.jar:1.14] at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:565) ~[jersey-client-1.14.jar:1.14] at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:517) ~[jersey-client-1.14.jar:1.14] at com.sun.jersey.api.client.WebResource.handle(WebResource.java:684) ~[jersey-client-1.14.jar:1.14] at com.sun.jersey.api.client.WebResource.get(WebResource.java:191) ~[jersey-client-1.14.jar:1.14] {code} JSONConfig uses the natural notation. I ran the code in debug mode and saw that in the method StAXStreamConnector.bridge(), in the while loop, there is no check concerning event XMLStreamConstants.END_DOCUMENT and the exception is raised exactly after the last element of the JSON response, at a point where the inputstream is at its end and the depth level is still at 1 (what I couldn't explain). The while loop expects the depth level to be 0 for a perfectly parsed input. Could you take a look and help me on this ? The JSON response is as follows {code} { "expand":"names,schema", "startAt":0, "maxResults":1, "total":4965, "issues":[ { "expand":"editmeta,renderedFields,transitions,changelog,operations", "id":"325150", "self":"https://example.com/jira/rest/api/latest/issue/325150", "key":"CITNET-5673", "fields":{ "summary":"Problem trying to attach Screenshot to JIRA issue", "progress":{ "progress":0, "total":0 }, "issuetype":{ "self":"https://example.com/jira/rest/api/2/issuetype/5", "id":"5", "description":"Support request on a product", "iconUrl":"https://example.com/jira/images/icons/help.png", "name":"Support", "subtask":false }, "timespent":null, "reporter":{ "self":"https://example.com/jira/rest/api/2/user?username=neessisd", "name":"neessisd", "emailAddress":"EMPL-EESSI-SERVICE-DESK@ec.europa.eu", "avatarUrls":{ "16x16":"https://example.com/jira/secure/useravatar?size=small&ownerId=neessisd&avatarId=10163", "48x48":"https://example.com/jira/secure/useravatar?ownerId=neessisd&avatarId=10163" }, "displayName":"EESSI SD", "active":true }, "customfield_10490":null, "created":"2012-10-10T12:00:11.000+0200", "updated":"2012-10-10T12:05:09.000+0200", "description":"Java error when trying to attach a Screenshot in JIRA.", "priority":{ "self":"https://example.com/jira/rest/api/2/priority/3", "iconUrl":"https://example.com/jira/images/icons/priority_major.gif", "name":"Major", "id":"3" }, "issuelinks":[ ], "customfield_12633":null, "customfield_12632":null, "customfield_12631":null, "customfield_12630":"98733", "subtasks":[ ], "status":{ "self":"https://example.com/jira/rest/api/2/status/1", "description":"The issue is open and ready for the assignee to start work on it.", "iconUrl":"https://example.com/jira/images/icons/status_open.gif", "name":"Open", "id":"1" }, "labels":[ ], "workratio":-1, "customfield_10250":null, "project":{ "self":"https://example.com/jira/rest/api/2/project/CITNET", "id":"10020", "key":"CITNET", "name":"_CITnet", "avatarUrls":{ "16x16":"https://example.com/jira/secure/projectavatar?size=small&pid=10020&avatarId=10254", "48x48":"https://example.com/jira/secure/projectavatar?pid=10020&avatarId=10254" } }, "environment":null, "aggregateprogress":{ "progress":0, "total":0 }, "components":[ { "self":"https://example.com/jira/rest/api/2/component/12599", "id":"12599", "name":"Jira", "description":"CITnet issues tracker (JIRA)" } ], "customfield_10010":null, "timeoriginalestimate":null, "customfield_10360":{ "self":"https://example.com/jira/rest/api/2/customFieldOption/10452", "value":"No", "id":"10452" }, "customfield_10580":null, "votes":{ "self":"https://example.com/jira/rest/api/2/issue/CITNET-5673/votes", "votes":0, "hasVoted":false }, "fixVersions":[ ], "resolution":null, "resolutiondate":null, "aggregatetimeoriginalestimate":null, "customfield_12634":null, "duedate":null, "customfield_12730":"Not Started", "customfield_12635":null, "customfield_12636":null, "customfield_12637":null, "customfield_12731":null, "customfield_12638":null, "customfield_12639":null, "watches":{ "self":"https://example.com/jira/rest/api/2/issue/CITNET-5673/watchers", "watchCount":1, "isWatching":false }, "customfield_10600":[ "neessisd:2" ], "assignee":null, "customfield_10590":null, "customfield_11730":null, "aggregatetimeestimate":null, "versions":[ ], "timeestimate":null, "aggregatetimespent":null } } ] } {code} Thx, -- Issa

    Java.net JIRA | 4 years ago | flopma
    java.lang.IllegalArgumentException: No more parsing elements.
  2. 0

    Nested Lists using Jersey-Json and Jaxb

    Stack Overflow | 3 years ago | user3439470
    java.lang.IllegalArgumentException: local part cannot be "null" when creating a QName at javax.xml.namespace.QName.<init>(QName.java:246) at javax.xml.namespace.QName.<init>(QName.java:299)
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Ints cannot be converted to iterable

    GitHub | 2 years ago | riedelcastro
    java.lang.IllegalArgumentException: -2147483648 until 2147483647 by 1: seqs cannot contain more than Int.MaxValue elements.
  5. 0

    Why is the Scala for-loop (and internals) NumericRange restricted to Int size and how to elaborate the functionality?

    Stack Overflow | 5 years ago | IODEV
    java.lang.IllegalArgumentException: 0 to 10000000000L by 1: "seqs cannot contain more than Int.MaxValue elements."

    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

      No more parsing elements.

      at com.sun.jersey.json.impl.reader.JsonXmlStreamReader.next()
    2. jersey-json
      JsonXmlStreamReader.next
      1. com.sun.jersey.json.impl.reader.JsonXmlStreamReader.next(JsonXmlStreamReader.java:503)[jersey-json-1.14.jar:1.14]
      1 frame
    3. Old JAXB Runtime
      UnmarshallerImpl.unmarshal
      1. com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:197)[jaxb-impl-2.2.3-1.jar:2.2.3]
      2. com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:366)[jaxb-impl-2.2.3-1.jar:2.2.3]
      3. com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:345)[jaxb-impl-2.2.3-1.jar:2.2.3]
      3 frames
    4. jersey-json
      JSONRootElementProvider.readFrom
      1. com.sun.jersey.json.impl.BaseJSONUnmarshaller.unmarshalJAXBElementFromJSON(BaseJSONUnmarshaller.java:111)[jersey-json-1.14.jar:1.14]
      2. com.sun.jersey.json.impl.BaseJSONUnmarshaller.unmarshalFromJSON(BaseJSONUnmarshaller.java:100)[jersey-json-1.14.jar:1.14]
      3. com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider.readFrom(JSONRootElementProvider.java:129)[jersey-json-1.14.jar:1.14]
      3 frames
    5. jersey-core
      AbstractRootElementProvider.readFrom
      1. com.sun.jersey.core.provider.jaxb.AbstractRootElementProvider.readFrom(AbstractRootElementProvider.java:111)[jersey-core-1.14.jar:1.14]
      1 frame
    6. jersey-client
      WebResource.get
      1. com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:565)[jersey-client-1.14.jar:1.14]
      2. com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:517)[jersey-client-1.14.jar:1.14]
      3. com.sun.jersey.api.client.WebResource.handle(WebResource.java:684)[jersey-client-1.14.jar:1.14]
      4. com.sun.jersey.api.client.WebResource.get(WebResource.java:191)[jersey-client-1.14.jar:1.14]
      4 frames