We have been using the Jira REST API for a few months in a product we are creating. We have recently been made to move to different development systems in a different lab. We are now seeing from our code is a sporadic java.lang.RuntimeException: java.net.ConnectException. We ARE using http and https proxies and these are being set via the System.setProperties() call. The code we are using that is seeing this problem is
JiraRestClient restClient = factory.createWithBasicHttpAuthentication(jiraServerUri,
_restClientContext.getUserName(), _restClientContext.getPassWord());
_logger.info("Connected to JIRA server : " + _restClientContext.getJiraServer());
User user = null;
int retry = 0;
RuntimeException exception = new RuntimeException("No problem");
while (retry < 10) {
try {
Promise<User> promise = restClient.getUserClient().getUser(_restClientContext.getUserName());
user = promise.claim();
I am not seeing the exceptions ALL the time with this code (meaning sometimes the getUserClient() call works) and prior to us having to move to a new lab environment we never had a problem with this code. I am guessing that it has something to do with a timeout somewhere down in the bowls of the http code. Is there a proper way to get a Socket or Connection timeout so we can increase it to see if this helps. I am guessing that we are going to promise.claim() and that the connection closes before we are able to get our result back (due to something going on in our lab network environment).
Roger
Hi @Roger Crerie ,
please try using factory as follow :
JiraRestClientFactory factory = new AsynchronousJiraRestClientFactory(); JiraRestClient restClient = factory.createWithBasicHttpAuthentication(...AS SPECIFIED IN YOUR CODE...)
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.