JSON Exception while using JRJC

Mohan V May 25, 2015

This is my code:

   

private  static  final  String JIRA_URL  = "http://10.87.176.162:8080/jira";

private  static  final  String JIRA_ADMIN_USERNAME  = "admin";

private  static  final  String JIRA_ADMIN_PASSWORD  = "admin";

 JiraRestClientFactory factory = new  AsynchronousJiraRestClientFactory();

 URI uri = new  URI(JIRA_URL );

JiraRestClient client = factory.createWithBasicHttpAuthentication(uri,

JIRA_ADMIN_USERNAME , JIRA_ADMIN_PASSWORD ); 

Promise<User> promise = client.getUserClient().getUser(mohan_venkatesan@infosys.com);

User user = promise.claim();

I am getting error as:

Exception in thread "main"

com.atlassian.jira.rest.client.RestClientException : org.codehaus.jettison.json.JSONException : A JSONObject text must begin with '{' at character 1 of <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>Oops, you&#39;ve found a dead link. - JIRA</title><script type="text/javascript">contextPath = "";</script><link type='text/css' rel='stylesheet' href='/static-assets/metal-all.css' media='all'><script src='/static-assets/metal-all.js'></script><!--[if lt IE 9]><link type='text/css' rel='stylesheet' href='/static-assets/metal-all-ie.css' media='all'><script src='/static-assets/metal-all-ie.js'></script><![endif]--><!--[if IE 9]><link type='text/css' rel='stylesheet' href='/static-assets/metal-all-ie9.css' media='all'><![endif]--><meta name="decorator" content="none" /></head><body class=" error-page error404"><script type="text/javascript">document.body.className += " js-enabled";</script><div id="page"><header id="header" role="banner"></header><!-- #header --><section id="content" role="main"><div class="aui-page-panel"><div class="aui-page-panel-inner"><section class="aui-page-panel-content lowerContent"><div id="error-state"><span class="error-type"></span><h1>Oops, you&#39;ve found a dead link.</h1><ul><li>Go back to the <a href="javascript:window.history.back()">previous page</a></li><li>Go to the <a href="/secure/MyJiraHome.jspa">Home Page</a></li></ul></div></section><!-- .aui-page-panel-content --></div><!-- .aui-page-panel-inner --></div><!-- .aui-page-panel --></section><!-- #content --><footer id="footer" role="contentinfo"><section class="footer-body">

 

 Pls help me, if you have any solution for this.

Thx,

Mohan GV

3 answers

0 votes
Timothy
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.
May 27, 2015

I'm not asking about your JIRA license. I am asking about your payload. What is the content you are sending to JIRA.

0 votes
Mohan V May 26, 2015

Hi Timothy, I beleive, you are asking about my JIRA licence requirement. I am using the trail version of JIRA. Thx...

0 votes
Timothy
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.
May 26, 2015

What is your payload?

Suggest an answer

Log in or Sign up to answer