Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,328,531
Community Members
 
Community Events
168
Community Groups

jira-rest-java-client-core - Getting URISyntaxException while getting project details

Hi all,

I am using jira-rest-java-client-core version 5.0.4 from our application to access our Jira Instance. 

Maven Dependency

<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-rest-java-client-core</artifactId>
<version>5.0.4</version>
</dependency>

 

I am trying to get the project details using below API

restClient.getProjectClient().getProject(key).claim();

 

I am getting below exception from one of the project,

Caused by: RestClientException{statusCode=Optional.absent(), errorCollections=[]}
at com.atlassian.jira.rest.client.internal.json.JsonParseUtil.parseURI(JsonParseUtil.java:177)
at com.atlassian.jira.rest.client.internal.json.IssueTypeJsonParser.parse(IssueTypeJsonParser.java:33)
at com.atlassian.jira.rest.client.internal.json.IssueTypeJsonParser.parse(IssueTypeJsonParser.java:25)
at com.atlassian.jira.rest.client.internal.json.JsonParseUtil.parseJsonArray(JsonParseUtil.java:51)
at com.atlassian.jira.rest.client.internal.json.JsonParseUtil.parseOptionalJsonArray(JsonParseUtil.java:61)
at com.atlassian.jira.rest.client.internal.json.ProjectJsonParser.parse(ProjectJsonParser.java:75)
at com.atlassian.jira.rest.client.internal.json.ProjectJsonParser.parse(ProjectJsonParser.java:36)
at com.atlassian.jira.rest.client.internal.async.AbstractAsynchronousRestClient$1.handle(AbstractAsynchronousRestClient.java:148)
at com.atlassian.jira.rest.client.internal.async.AbstractAsynchronousRestClient$3.apply(AbstractAsynchronousRestClient.java:189)
at com.atlassian.jira.rest.client.internal.async.AbstractAsynchronousRestClient$3.apply(AbstractAsynchronousRestClient.java:185)
at com.atlassian.httpclient.api.ResponsePromiseMapFunction.apply(ResponsePromiseMapFunction.java:81)
at com.atlassian.httpclient.api.ResponsePromiseMapFunction.apply(ResponsePromiseMapFunction.java:11)
at com.atlassian.util.concurrent.Promises$Of$3.apply(Promises.java:295)
at com.atlassian.util.concurrent.Promises$2.onSuccess(Promises.java:185)
at com.google.common.util.concurrent.Futures$4.run(Futures.java:1169)
at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:297)
at com.google.common.util.concurrent.ExecutionList.executeListener(ExecutionList.java:156)
at com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:145)
at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:185)
at com.google.common.util.concurrent.SettableFuture.set(SettableFuture.java:53)
at com.atlassian.util.concurrent.Promises$Of$3.apply(Promises.java:295)
at com.atlassian.util.concurrent.Promises$2.onSuccess(Promises.java:185)
at com.google.common.util.concurrent.Futures$4.run(Futures.java:1169)
at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:297)
at com.google.common.util.concurrent.ExecutionList.executeListener(ExecutionList.java:156)
at com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:145)
at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:185)
at com.google.common.util.concurrent.SettableFuture.set(SettableFuture.java:53)
at com.atlassian.httpclient.apache.httpcomponents.SettableFuturePromiseHttpPromiseAsyncClient$1$1.run(SettableFuturePromiseHttpPromiseAsyncClient.java:46)
at com.atlassian.httpclient.apache.httpcomponents.SettableFuturePromiseHttpPromiseAsyncClient$ThreadLocalDelegateRunnable$1.run(SettableFuturePromiseHttpPromiseAsyncClient.java:197)
at com.atlassian.httpclient.apache.httpcomponents.SettableFuturePromiseHttpPromiseAsyncClient.runInContext(SettableFuturePromiseHttpPromiseAsyncClient.java:90)
at com.atlassian.httpclient.apache.httpcomponents.SettableFuturePromiseHttpPromiseAsyncClient$ThreadLocalDelegateRunnable.run(SettableFuturePromiseHttpPromiseAsyncClient.java:192)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.URISyntaxException: Illegal character in path at index 47: https://<HOST>/images/icons/Remove Monitoring.png
at java.net.URI$Parser.fail(URI.java:2848)
at java.net.URI$Parser.checkChars(URI.java:3021)
at java.net.URI$Parser.parseHierarchical(URI.java:3105)
at java.net.URI$Parser.parse(URI.java:3053)
at java.net.URI.<init>(URI.java:588)
at com.atlassian.jira.rest.client.internal.json.JsonParseUtil.parseURI(JsonParseUtil.java:175)
... 34 more

 

Noticed that there is a space in one of the project metadata URI. 

Caused by: java.net.URISyntaxException: Illegal character in path at index 47: https://<HOST>/images/icons/Remove Monitoring.png

 

How can we handle this using jira rest client apis ?

 

0 comments

Comment

Log in or Sign up to comment
TAGS
Community showcase
Published in Jira Software

An update on Jira Software customer feedback – June 2022

Hello Atlassian Community! Feedback from customers like you has helped us shape and improve Jira Software. As Head of Product, Jira Software, I wanted to take this opportunity to share an update on...

2,786 views 7 24
Read article

Atlassian Community Events