Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

HELP . Java REST client suddenly stopped working at 9.30 this morning

Robot User February 19, 2020

The most basic function getIssue suddenly started failing with the error message 

RestClientException{statusCode=Optional.absent(), errorCollections=[]}

at around 9.30 this morning. I can curl the REST API directly no problem. I am using the basic auth with email and token as recommended, this has been working for ages.

 

Has something changed ? Anyone else experiencing this ? 

 

It's a Jira cloud instance

2 answers

0 votes
Alexander_Piorecki February 20, 2020

I had the same problem - since the PR is still waiting to be merged (and we can't wait for that to happen) - I did:

- cloned the repo: 'git clone https://bitbucket.org/atlassian/jira-rest-java-client.git'

- had to clean some pom dependencies which were not available for some reason - and only kept api and core modules

- changed the file JsonParseUtil, line 192 to: 

final String username = json.optString("name");

- build the jars (core and api)

- copied them to our project into src/main/resources (I had to reuse the .pom file from release 5.1.6 as they were not generated by maven for 5.1.7 for some reason)

- then followed: https://www.baeldung.com/install-local-jar-with-maven/

- finally built our project

 

Above at least worked for me ;o) But would be nice to get the official library release...

Alexander_Piorecki February 20, 2020

note - it's the core package which contains the breaking code - so might be sufficient to update the maven dependency for that package (after applying above file change)

mmendoza
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 20, 2020

How did you know which dependencies to delete?

Alexander_Piorecki February 21, 2020

Essentially the ones giving problems ;o)

1) I removed all the reporting plugins from all pom's

 

2) Then added:

<properties>
    <java.version>1.8</java.version>
</properties>

to child pom's of api and core (we are on Java 8).

 

3) Finally added to the main pom: 

<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>

 

Note:

api/src/main/java/com/atlassian/jira/rest/client/api/domain/EntityHelper.java

gave me some compilation problems - I did however just let Intellij resolve it - it was some unimplemented predicate methods.

 

Above might not be the right of doing it - but got me past the issues ;o)

0 votes
Robot User February 20, 2020

I got it working , this thread was useful. 

https://community.atlassian.com/t5/Jira-questions/Jira-REST-Java-Client-Exception-since-Mid-February-2020/qaq-p/1303165

 

Specifically changing JsonParseUtil.java

thanks

Suggest an answer

Log in or Sign up to answer