taskadapter / redmine-java-api

Redmine Java API
Apache License 2.0
270 stars 163 forks source link

com.taskadapter.redmineapi.RedmineFormatException while retrieving Custom Fields #379

Open stoldorma opened 1 year ago

stoldorma commented 1 year ago

Hello,

I'm facing following Exception while retriving Custom Fields:

Code:

redmineManager.getCustomFieldManager().getCustomFieldDefinitions().forEach(cf -> {
    System.err.println("custom field: " + cf.getName());
});

Exception:

com.taskadapter.redmineapi.RedmineFormatException: org.json.JSONException: JSONObject["trackers"] is not a JSONArray (class org.json.JSONObject).
    at com.taskadapter.redmineapi.internal.Transport.getObjectsListNoPaging(Transport.java:495)
    at com.taskadapter.redmineapi.internal.Transport.getObjectsList(Transport.java:460)
    at com.taskadapter.redmineapi.internal.Transport.getObjectsList(Transport.java:437)
    at com.taskadapter.redmineapi.CustomFieldManager.getCustomFieldDefinitions(CustomFieldManager.java:43)

...

Caused by: org.json.JSONException: JSONObject["trackers"] is not a JSONArray (class org.json.JSONObject).
    at org.json.JSONObject.wrongValueFormatException(JSONObject.java:2698)
    at org.json.JSONObject.getJSONArray(JSONObject.java:767)
    at com.taskadapter.redmineapi.internal.RedmineJSONParser.parseCustomFieldDefinition(RedmineJSONParser.java:534)
    at com.taskadapter.redmineapi.internal.json.JsonInput.getListOrNull(JsonInput.java:58)
    at com.taskadapter.redmineapi.internal.Transport.getObjectsListNoPaging(Transport.java:489)
    ... 108 more

pom.xml:

<dependency>
    <groupId>com.taskadapter</groupId>
    <artifactId>redmine-java-api</artifactId>
    <version>4.0.0.preview.3</version>
</dependency>
<dependency> 
    <groupId>org.json</groupId>
    <artifactId>json</artifactId>
 <version>20090211</version>
</dependency>

I'm using 2.4.6.stable Version on the Server.