Forums

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

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

Joshua Azicate September 12, 2019

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! 

2 answers

1 accepted

1 vote
Answer accepted
DPKJ
Community Champion
September 12, 2019

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'
Joshua Azicate September 12, 2019

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 :

DPKJ
Community Champion
September 12, 2019

Do you have,

repositories {
    jcenter()
    mavenCentral()
}

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

Joshua Azicate September 17, 2019

Forgot to let you know but it works. Thanks!

0 votes
Roma Bubyakin _Wombats Corp_
Contributor
January 30, 2025

I'm here after several years =)

If you use maven delete <scope> to make it compile, but only on problematic dependency

<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.2.2-atlassian-1</version>
<scope>provided</scope>
</dependency>

Suggest an answer

Log in or Sign up to answer