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,299,894
Community Members
 
Community Events
165
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

Upcoming changes to epic fields in company-managed projects

👋 Hi there Jira Community! A few months ago we shared with you plans around renaming epics in your company-managed projects. As part of these changes, we highlighted upcoming changes to epics on...

15,033 views 37 49
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