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! 

1 answer

1 accepted

1 vote
Answer accepted
DPKJ
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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 Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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!

Suggest an answer

Log in or Sign up to answer