Hello,
I'm using jira rest java client api and I tried to print all issues in console window. While going through the JRJC tutorial, I have come across "Client response status: 405". Currently, I can get project for a given key.
ProjectRestClient projectClient = restClient.getProjectClient(); System.out.println(projectClient.getProject("BILMAN", pm));
Then I changed my code to get all issues from jira
ProjectRestClient projectClient = restClient.getProjectClient(); Iterable<BasicProject> allProjects = projectClient.getAllProjects(pm); for (BasicProject basicProject : allProjects) { System.out.println(basicProject.getName() + " " + basicProject.getKey()); }
but it throws this exception. Please help me to understand why this is happening.
Exception in thread "main" com.atlassian.jira.rest.client.RestClientException: com.sun.jersey.api.client.UniformInterfaceException: Client response status: 405
at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.invoke(AbstractJerseyRestClient.java:70)
at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.getAndParse(AbstractJerseyRestClient.java:92)
at com.atlassian.jira.rest.client.internal.jersey.JerseyProjectRestClient.getAllProjects(JerseyProjectRestClient.java:71)
at wjhk.jupload2.jira.Example1.main(Example1.java:29)
Caused by: com.sun.jersey.api.client.UniformInterfaceException: Client response status: 405
at com.sun.jersey.api.client.WebResource.handle(WebResource.java:607)
at com.sun.jersey.api.client.WebResource.get(WebResource.java:187)
at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient$2.call(AbstractJerseyRestClient.java:96)
at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.invoke(AbstractJerseyRestClient.java:54)
... 3 more
Community moderators have prevented the ability to post new answers.
Hi, I got it ..... :) :)
It worked for me by changing the server version to 5, and client version to 5. I think there were some issues in JIRA-4.1.4.
The Same thing here WITH SAME CODE But version is 5.0 ... !! SAME EXCEPTION ,..... !!!! :( :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
A 405 status means, that the method (GET, POST, PUT, DELETE, ...) is not allowed.
It looks like getAllProjects() accepts other methods than getProject(). Can you sniff the network (e.g. with WireShark) and see which method is being used?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.