Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Connection to https://apitest.authorize.net refused': 'java.net.ConnectException: Connection refused: connect', '[org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:127), org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:147), org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:108), org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:415), org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:641), org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:576), org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:554), net.authorize.util.HttpClient.executeXML(HttpClient.java:227), net.authorize.Merchant.postTransaction(Merchant.java:298), com.auth.net.commons.authorize.net.SettledTransactionDetails.main(SettledTransactionDetails.java:39)]' #99

Closed
JavaNeed opened this issue Aug 18, 2016 · 3 comments

Comments

@JavaNeed
Copy link

Hello,

I am facing below error:

2016-08-18 11:28:34 INFO  net.authorize.util.HttpClient - Use Proxy: 'false'
2016-08-18 11:28:34 DEBUG o.a.h.i.conn.SingleClientConnManager - Get connection for route HttpRoute[{s}->https://apitest.authorize.net]
2016-08-18 11:28:35 DEBUG o.a.h.i.conn.DefaultClientConnection - Connection shut down
2016-08-18 11:28:35 DEBUG o.a.h.i.conn.SingleClientConnManager - Releasing connection org.apache.http.impl.conn.SingleClientConnManager$ConnAdapter@14a2ec7
2016-08-18 11:28:35 WARN  net.authorize.util.HttpClient - Exception getting response: 'Connection to https://apitest.authorize.net refused': 'java.net.ConnectException: Connection refused: connect', '[org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:127), org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:147), org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:108), org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:415), org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:641), org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:576), org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:554), net.authorize.util.HttpClient.executeXML(HttpClient.java:227), net.authorize.Merchant.postTransaction(Merchant.java:298), com.auth.net.commons.authorize.net.SettledTransactionDetails.main(SettledTransactionDetails.java:39)]'
Exception in thread "main" java.lang.NullPointerException
    at net.authorize.reporting.Result.importRefId(Result.java:490)
    at net.authorize.reporting.Result.createResult(Result.java:58)
    at net.authorize.Merchant.postTransaction(Merchant.java:299)
    at com.auth.net.commons.authorize.net.SettledTransactionDetails.main(SettledTransactionDetails.java:39)

It looks like proxy is enabled and which is blocking the transaction to be hit to target system. We must need to set/write proxy code to allow proxy to pass this transaction in the following code, how we can do that ? Does Auth.net SDK allows such provision? It looks to me that Auth.net using HTTPClient API to make the call, so it must be possible to do that isn't it ?

@gnongsie
Copy link
Contributor

Hi @JavaNeed, are you working behind a proxy? Does it require authentication (username, password) to use the internet?

@kikmak42
Copy link
Contributor

kikmak42 commented Aug 23, 2016

@JavaNeed if you are using our SDK via Maven, you will need to set proxy in environment variables

https.proxyUse true
https.proxyHost _PROXY_HOST_
https.proxyPort _PROXY_PORT_

or add set Java System property for proxy in your application before your application calls the SDK like this :

    System.setProperty("https.proxyUse", "true");
    System.setProperty("https.proxyHost", "127.0.0.1");
    System.setProperty("https.proxyPort", "8080");
    System.setProperty("http.proxyUse", "true");
    System.setProperty("http.proxyHost", "127.0.0.1");
    System.setProperty("http.proxyPort", "8080");

Hope this helps.

@gnongsie
Copy link
Contributor

gnongsie commented Dec 5, 2017

Hi @JavaNeed , we are closing this issue for now. Do let us know if you are still facing any difficulty with this. Also feel free to open an issue if you have any other problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants
@kikmak42 @gnongsie @JavaNeed and others