It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Exception in thread "main" java.lang.NoClassDefFoundError: com/atlassian/jira/rest/client/internal/a

Exception in thread "main" java.lang.NoClassDefFoundError: com/atlassian/jira/rest/client/internal/async/AsynchronousJiraRestClientFactory
at MyJiraClient.getJiraRestClient(MyJiraClient.java:67)
at MyJiraClient.<init>(MyJiraClient.java:25)
at Main.main(Main.java:13)
Caused by: java.lang.ClassNotFoundException: com.atlassian.jira.rest.client.internal.async.AsynchronousJiraRestClientFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 3 more

Caused by: java.lang.ClassNotFoundException: com.atlassian.jira.rest.client.internal.async.AsynchronousJiraRestClientFactory

 

Here are my dependencies in gradle:

dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'

// implementation 'com.google.code.gson:gson:2.8.5'
// https://mvnrepository.com/artifact/com.google.code.gson/gson
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.5'

compileOnly 'com.atlassian.jira:jira-rest-java-client-core:5.0.4'
compileOnly 'com.atlassian.jira:jira-rest-java-client-api:5.0.4'
compileOnly 'com.atlassian.fugue:fugue:2.6.1'
}

Please help. Thanks! 

1 answer

1 accepted

1 vote
Answer accepted

In your gradle dependencies, replace this

compileOnly 'com.atlassian.jira:jira-rest-java-client-core:5.0.4'
compileOnly 'com.atlassian.jira:jira-rest-java-client-api:5.0.4'
compileOnly 'com.atlassian.fugue:fugue:2.6.1'

 with,

compile 'com.atlassian.jira:jira-rest-java-client-core:5.0.4'
compile 'com.atlassian.jira:jira-rest-java-client-api:5.0.4'
compile 'com.atlassian.fugue:fugue:2.6.1'

I ended up getting this error:

> Task :compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
> Could not find com.atlassian.jira:jira-rest-java-client-core:5.0.4.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/com/atlassian/jira/jira-rest-java-client-core/5.0.4/jira-rest-java-client-core-5.0.4.pom
- https://repo.maven.apache.org/maven2/com/atlassian/jira/jira-rest-java-client-core/5.0.4/jira-rest-java-client-core-5.0.4.jar
Required by:
project :
> Could not find com.atlassian.jira:jira-rest-java-client-api:5.0.4.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/com/atlassian/jira/jira-rest-java-client-api/5.0.4/jira-rest-java-client-api-5.0.4.pom
- https://repo.maven.apache.org/maven2/com/atlassian/jira/jira-rest-java-client-api/5.0.4/jira-rest-java-client-api-5.0.4.jar
Required by:
project :
> Could not find com.atlassian.fugue:fugue:2.6.1.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/com/atlassian/fugue/fugue/2.6.1/fugue-2.6.1.pom
- https://repo.maven.apache.org/maven2/com/atlassian/fugue/fugue/2.6.1/fugue-2.6.1.jar
Required by:
project :

Do you have,

repositories {
    jcenter()
    mavenCentral()
}

in you build.gradle file, if not please add and try again.

Forgot to let you know but it works. Thanks!

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

Jira Cloud for Google Sheets: Automatically Refresh Your Data!

Remember that time you realized it was possible to refresh your Jira data in Google sheets with just one click? What if we told you that you can now get the latest data with no clicks at all?! Zero! ...

151 views 1 7
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you