Recurly:通过我的代码在Recurly服务器连接期间拒绝连接

时间:2015-12-24 08:01:45

标签: java eclipse recurly

我正在尝试在我的重复帐户中创建客户帐户。         我得到了私钥,因为我为了开发目的而重新创建了一个帐户。         使用该密钥和域名我试图将客户详细信息添加到我的重复帐户。         出于测试目的,我只是在Account对象中随机创建一个帐户ID和名字,并将其发送到recurly帐户(我的帐户)。         但在连接到Recurly服务器时,我遇到了错误。         我已经验证了连接似乎没问题。从网上我能够登录并连接到recurly服务器。

        public static void main(String[] args) {
        // TODO Auto-generated method stub

        // key and domain were correctly written

        final String apiKey = "******";     
        final String Domain = "*****";

        Account account = new Account();
        account.setAccountCode(UUID.randomUUID().toString());
        account.setFirstName("Jeet");

        RecurlyClient recurlyClient = new RecurlyClient(apiKey, Domain);

        // opening the recurly server.
        recurlyClient.open();  

        // creating account
        recurlyClient.createAccount(account);  



    Error logs: 

    3559 [main] ERROR com.ning.billing.recurly.RecurlyClient - Execution error
                        java.util.concurrent.ExecutionException: java.net.ConnectException: Connection refused: connect
                            at com.ning.http.client.providers.jdk.JDKFuture.get(JDKFuture.java:139)
                            at com.ning.http.client.providers.jdk.JDKFuture.get(JDKFuture.java:114)
                            at com.ning.billing.recurly.RecurlyClient.callRecurly(RecurlyClient.java:936)
                            at com.ning.billing.recurly.RecurlyClient.callRecurlySafe(RecurlyClient.java:905)
                            at com.ning.billing.recurly.RecurlyClient.doPOST(RecurlyClient.java:875)
                            at com.ning.billing.recurly.RecurlyClient.createAccount(RecurlyClient.java:172)
                            at ClientTesting.main(ClientTesting.java:24)



    Caused by: java.net.ConnectException: Connection refused: connect
                            at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
                            at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
                            at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
                            at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
                            at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
                            at java.net.PlainSocketImpl.connect(Unknown Source)
                            at java.net.SocksSocketImpl.connect(Unknown Source)
                            at java.net.Socket.connect(Unknown Source)
                            at sun.security.ssl.SSLSocketImpl.connect(Unknown Source)
                            at sun.net.NetworkClient.doConnect(Unknown Source)
                            at sun.net.www.http.HttpClient.openServer(Unknown Source)
                            at sun.net.www.http.HttpClient.openServer(Unknown Source)
                            at sun.net.www.protocol.https.HttpsClient.<init>(Unknown Source)
                            at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
                            at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source)
                            at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(Unknown Source)
                            at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
                            at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
                            at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(Unknown Source)
                            at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
                            at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown Source)
                            at com.ning.http.client.providers.jdk.JDKAsyncHttpProvider$AsyncHttpUrlConnection.configure(JDKAsyncHttpProvider.java:556)
                            at com.ning.http.client.providers.jdk.JDKAsyncHttpProvider$AsyncHttpUrlConnection.call(JDKAsyncHttpProvider.java:232)
                            at java.util.concurrent.FutureTask.run(Unknown Source)
                            at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
                            at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
                            at java.lang.Thread.run(Unknown Source)

0 个答案:

没有答案