Not able to create a JiraRestClient

I am trying to create a JiraRestClient using Basic authentication.

JiraRestClientFactory factory = new AsynchronousJiraRestClientFactory();

URI jiraServerUri = getJiraUri();
JiraRestClient restClient = factory
.createWithBasicHttpAuthentication(jiraServerUri, USERNAME, PASSWORD);

 However, I am getting the below exception:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" java.lang.NoSuchMethodError: com.atlassian.fugue.Option.fold(Lcom/google/common/base/Supplier;Lcom/google/common/base/Function;)Ljava/lang/Object;
at com.atlassian.httpclient.apache.httpcomponents.proxy.ProxyConfigFactory.getProxyHost(ProxyConfigFactory.java:16)
at com.atlassian.httpclient.apache.httpcomponents.ApacheAsyncHttpClient.<init>(ApacheAsyncHttpClient.java:211)
at com.atlassian.httpclient.apache.httpcomponents.ApacheAsyncHttpClient.<init>(ApacheAsyncHttpClient.java:123)
at com.atlassian.httpclient.apache.httpcomponents.DefaultHttpClientFactory.doCreate(DefaultHttpClientFactory.java:68)
at com.atlassian.httpclient.apache.httpcomponents.DefaultHttpClientFactory.create(DefaultHttpClientFactory.java:35)
at com.atlassian.jira.rest.client.internal.async.AsynchronousHttpClientFactory.createClient(AsynchronousHttpClientFactory.java:63)
at com.atlassian.jira.rest.client.internal.async.AsynchronousJiraRestClientFactory.create(AsynchronousJiraRestClientFactory.java:35)
at com.atlassian.jira.rest.client.internal.async.AsynchronousJiraRestClientFactory.createWithBasicHttpAuthentication(AsynchronousJiraRestClientFactory.java:42)
at com.jira.JiraClient.getJiraRestClient(JiraClient.java:37)
at com.jira.JiraClient.getIssue(JiraClient.java:25)
at com.jira.JiraClient.main(JiraClient.java:20)

Below is my Pom.xml:

<dependencies>
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-rest-java-client-core</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>com.atlassian.fugue</groupId>
<artifactId>fugue</artifactId>
<version>3.0.0-m007</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.21</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>atlassian-public</id>
<url>https://packages.atlassian.com/maven/repository/public</url>
</repository>
</repositories> 

 

3 answers

1 accepted

1 vote
Accepted answer

The version of fugue compatible with JRJC 4.0.0is 2.6.1

<dependency>
    <groupId>com.atlassian.fugue</groupId>
    <artifactId>fugue</artifactId>
    <version>2.6.1</version>
</dependency>
0 votes
Timothy Chin Community Champion Sep 24, 2017

The dependencies seem correct. Have you tried making sure that you do a maven clean and then repackage the code?

Yeah, I did that just now, no luck.

0 votes
Tarun Sapra Community Champion Sep 25, 2017

Try adding the binding jar file

 

<dependency>
 <groupId>org.slf4j</groupId>
 <artifactId>slf4j-jdk14</artifactId>
 <version>1.7.25</version>
</dependency>

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Mar 28, 2018 in Jira Software

Can a company’s culture make or break agile adoption?

Can a new-to-agile team survive and thrive in a non-agile culture? If so, what advice would you give to those trying to be agile in a non-agile culture? What's the key(s) to success? Share your thoug...

17,657 views 18 20
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you