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

Client response status: 405

osman osman May 24, 2012

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

3 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Rajakrishna Reddy August 7, 2012

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.

0 votes
Rajakrishna Reddy August 7, 2012

The Same thing here WITH SAME CODE But version is 5.0 ... !! SAME EXCEPTION ,..... !!!! :( :(

0 votes
Nabil Sayegh
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 7, 2012

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?

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events