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

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

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.

Man, formatting this is painfull:

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


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?

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

-Dhttp.noProxyHosts=”localhost|directaccessible.mydomain.com”
I am using Jira CLI.

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

-Dhttp.noProxyHosts=”localhost|directaccessible.mydomain.com”
This will not work for https

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.

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?

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.

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.

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

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 31, 2018 in Marketplace Apps

Marketplace Spotlight: Zephyr

Hello Atlassian Community! Each month, we run a series of Spotlights to highlight Marketplace vendors and apps that our team thinks this Community would find valuable. In last month's Spotlig...

412 views 0 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you