Connection Exception:java.net.ConnectException: Connection refused: connect

arun kumar August 21, 2012

I am using Jira CLI for some automation project.

But when I try to run the command.. I got this error message.

C:\jira-cli-2.6.0>jira --server "xxxxxx" --user xxxx --p
assword xxxxx --action getServerInfo
Unable to log in to server: https://www.xxxx.com/jira/rpc/soap/jirasoapservic
e-v2
with user: xxxxx.
Cause: ; nested exception is:
java.net.ConnectException: Connection refused: connect

How can I fix this problem?

3 answers

2 votes
Bob Swift OSS (Bob Swift Atlassian Apps)
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 21, 2012

Make sure you can ping or access from a brower the address: https://www.teamccp.com/jira . Then make sure you can go to https://www.teamccp.com/jira/rpc/soap/jirasoapservice-v2 from a browser as well. Do this from the same system you are trying to run the CLI command from.

Radu Dumitriu
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 21, 2012

Man, formatting this is painfull:

-Dhttp.proxyHost=proxy.mydomain.com -Dhttp.proxyPort=8080
 -Dhttp.noProxyHosts=”localhost|directaccessible.mydomain.com”


arun kumar August 21, 2012

Tnks Bob,

I can access that url from my browser. I am working in company where be enabled proxy server. But that command (jira cli) is executing in shell.

From my observation from netstat -n command, I found one thing.

The jira server request are to its actual IP (resolved one from our dns server) instead of throgh my proxy server.

How can I set my Jira CLI Api to use our proxy server?

arun kumar August 22, 2012

How can I set this?????????

-Dhttp.noProxyHosts=”localhost|directaccessible.mydomain.com”
I am using Jira CLI.
arun kumar August 22, 2012

Dhttp.proxyHost=proxy.mydomain.com -Dhttp.proxyPort=8080

-Dhttp.noProxyHosts=”localhost|directaccessible.mydomain.com”
This will not work for https
Bob Swift OSS (Bob Swift Atlassian Apps)
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 22, 2012

Put this in your jira.bat/jira.sh or atlassian.bat/atlassian.sh file so you don't need to worry about it. Use the https based version of what was indicated above - https://answers.atlassian.com/questions/55443/how-to-instruct-rest-to-use-a-proxy/55470 is another example.

arun kumar August 23, 2012

Tnks Bob,

But even if I set these, the http request not goes to proxy server.. I tested -Dhttp with other java programs, i works correctly. But this JIra Cli CLient skips this settings, and request do not goes to proxy server. I think it the problem of JIra Cli client. Am I right?

Bob Swift OSS (Bob Swift Atlassian Apps)
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 23, 2012

Not that I am aware of. I don't have that configuration. Perhaps someone with that configuration can provide more specific configuration information for you.

0 votes
Leos Junek
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 11, 2014

I have faced the same problem. I could open http://jiratest.a.com/jira/rpc/soap/jirasoapservice-v2 from my Windows desktop, but it could not be opened on Linux server where JIRA was installed. It was caused by iptables, where this conf is written

*nat
-A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080

While I got

$ wget http://jiratest.a.local/jira/rpc/soap/jirasoapservice-v2
--2014-08-01 13:50:01--  http://jiratest.a.local/jira/rpc/soap/jirasoapservice-v2
Resolving jiratest.a.local... 10.0.1.61
Connecting to jiratest.a.local|10.0.1.61|:80... failed: Connection refused.

a little bit change in port number helped

wget http://jiratest.a.local:8080/rpc/soap/jirasoapservice-v2
--2014-08-01 14:01:05--  http://jiratest.a.local:8080/rpc/soap/jirasoapservice-v2
Resolving jiratest.a.local... 10.0.1.61
Connecting to jiratest.a.local|10.0.1.61|:8080... connected.
HTTP request sent, awaiting response... 200 OK

0 votes
Alexander Artemov December 26, 2012

I have the same problem from our CentOS servers and no such problem from my Ubuntu machine. So, the problem is not with the jira-cli client. Maybe the problem is with java - it is different on machines.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events