I am trying to login jira from polarion

kunti pawar January 28, 2019

I am getting below error

Could you please let me know how I can resolve the below errors

org.apache.http.impl.client.cache.CacheConfig.setNeverCache1_0ResponsesWithQueryString(Z)V

Details:

java.lang.NoSuchMethodError: org.apache.http.impl.client.cache.CacheConfig.setNeverCache1_0ResponsesWithQueryString(Z)V
at com.atlassian.httpclient.apache.httpcomponents.DefaultHttpClient.<init>(DefaultHttpClient.java:155)
at com.atlassian.jira.rest.client.internal.async.AsynchronousHttpClientFactory.createClient(AsynchronousHttpClientFactory.java:53)
at com.atlassian.jira.rest.client.internal.async.AsynchronousJiraRestClientFactory.create(AsynchronousJiraRestClientFactory.java:35)

2 answers

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 29, 2019

The problem you have is that you have code in Polarion plugin which is using a library called the Jira Rest Java Client (JRJC).  The code that is trying to use JRJC is incorrect, trying to make calls in the library that are wrong.

Rambabu has suggested an answer that shows you how to code without the JRJC which will fix the problem (and uses maven to build), instead of fixing the code using JRJC.

Either way, you're going to need to write code that can log in correctly.  If you want us to help, you'll need to show us the code and let us know the version of JRJC you are using.

kunti pawar January 29, 2019

Thanks Nic Brough for Information and update,

I am using same code and same jar in Eclipse then it works fine but I want call same code from polarion.

I am using 7.13 version of jira.

I am new Developer for Jira, So I need Help.

Thanks in Advance.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 29, 2019

I am sorry, we can't tell you anything more than "the code you have in Polarion trying to use the JRJC is broken".  It's asking the JRJC to something it does not have support for.  Without the code that is broken, we can't tell you where to look.

kunti pawar January 29, 2019

Hello Nic Brough,

I am using (jira-rest-java-client-core-2.0.0-m32.w1) jar for the below code

 

URI jiraServerUri = URI.create("HostName:6001");

AsynchronousJiraRestClientFactory factory = new AsynchronousJiraRestClientFactory();

AuthenticationHandler auth = new BasicHttpAuthenticationHandler("1370585", "kunti");
JiraRestClient restClient = factory.create(jiraServerUri, auth);
IssueRestClient issueClient = restClient.getIssueClient();

try {
IssueInputBuilder iib = new IssueInputBuilder("PLCI",10002L,"kunti");
iib.setDescription("Test Description");

IssueInput issue = iib.build();
BasicIssue issueObj = issueClient.createIssue(issue).claim();

System.out.println("Issue " + issueObj.getKey() + " created successfully");
} finally {
restClient.close();
}

Could you please let me know what I am missing on same code?

Thanks in Advance :)

kunti pawar January 29, 2019

Hello Nic Brough,

I am using (jira-rest-java-client-core-2.0.0-m32.w1) jar for the below code

 

URI jiraServerUri = URI.create("HostName:6001");

AsynchronousJiraRestClientFactory factory = new AsynchronousJiraRestClientFactory();

AuthenticationHandler auth = new BasicHttpAuthenticationHandler("1370585", "kunti");
JiraRestClient restClient = factory.create(jiraServerUri, auth);
IssueRestClient issueClient = restClient.getIssueClient();

try {
IssueInputBuilder iib = new IssueInputBuilder("PLCI",10002L,"kunti");
iib.setDescription("Test Description");

IssueInput issue = iib.build();
BasicIssue issueObj = issueClient.createIssue(issue).claim();

System.out.println("Issue " + issueObj.getKey() + " created successfully");
} finally {
restClient.close();
}

Could you please let me know what I am missing on same code?

Thanks in Advance :)

kunti pawar January 29, 2019

Hello Nic Brough,

I am using (jira-rest-java-client-core-2.0.0-m32.w1) jar for the below code 

URI jiraServerUri = URI.create("HostName:6001");

AsynchronousJiraRestClientFactory factory = new AsynchronousJiraRestClientFactory();

AuthenticationHandler auth = new BasicHttpAuthenticationHandler("1370585", "kunti");
JiraRestClient restClient = factory.create(jiraServerUri, auth);
IssueRestClient issueClient = restClient.getIssueClient();

try {
IssueInputBuilder iib = new IssueInputBuilder("PLCI",10002L,"kunti");
iib.setDescription("Test Description");

IssueInput issue = iib.build();
BasicIssue issueObj = issueClient.createIssue(issue).claim();

System.out.println("Issue " + issueObj.getKey() + " created successfully");
} finally {
restClient.close();
}

Could you please let me know what I am missing on same code?

Thanks in Advance :)

0 votes
Rambabu Patina _Appfire_
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.
January 28, 2019

Hi @kunti pawar, Please have a look on similar question. Thanks.

kunti pawar January 28, 2019

Thanks Rambabu Patina for quick response.

 

Actully I am not using maven project I am calling jira from polarion plugin.

Could you please let me know I am missing any jar for the same eerror.

Suggest an answer

Log in or Sign up to answer