Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Jira REST API client - java.lang.ClassNotFoundException: javax.ws.rs.core.UriBuilder

Anbuchezhiyan
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!
July 10, 2024

Hi All,

Trying to implement Jira Rest API client using sprinBoot 3.x and Java 17 version.

Getting the below error while implementing , came to know that JiraRestClient ( AsynchronousJiraRestClient )still uses javax.ws.rs.core, but springboot 3.x  version moved to jakarta.ws.rs.core  hence the below error.

Is there any workaround or alterante approach to proceed further. Please suggest.

ERROR:

java.lang.ClassNotFoundException: javax.ws.rs.core.UriBuilder at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) ~[na:na] at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) ~[na:na] at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[na:na] at com.atlassian.jira.rest.client.internal.async.AsynchronousJiraRestClient.(AsynchronousJiraRestClient.java:58) ~[jira-rest-java-client-core-5.2.4.jar:na] at com.atlassian.jira.rest.client.internal.async.AsynchronousJiraRestClientFactory.create(AsynchronousJiraRestClientFactory.java:37) ~[jira-rest-java-client-core-5.2.4.jar:na] at

2 comments

Jenil Kukadiya August 2, 2024

I've encountered the same error. Have you found a solution? If so, please share it with me.

Tetiana Tvardovska
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!
August 8, 2024

The only solution for now is to downgrade transitive dependency to use a old javax package instead of a new jakarta package.

In Gradle build.gradle:

dependencies {
implementation("com.atlassian.jira:jira-rest-java-client-core:5.2.7") {
exclude(group = "org.glassfish.jersey.core", module = "jersey-common")
}
implementation("org.glassfish.jersey.core:jersey-common:2.35")
compileOnly("io.atlassian.fugue:fugue:5.0.1")
}

 

Solution was inspired by the answer here(*) , but updated to the latest working packages versions.

*) https://stackoverflow.com/a/76661651/1073764

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events