Connection refused error

21 views
Skip to first unread message

Tamara

unread,
Nov 30, 2007, 6:21:24 AM11/30/07
to typica
Hi,

I've just downloaded typica-0.8 to use with SQS.

This is how I've setup the enviornment:

1) Set the classpath to contain:

logging.properties
Log4J.xml
jaxb-api-2.0.jar
commons-logging-1.1.1.jar
typica.jar
llog4j-1.2.15.jar

2) Modified EnqueueSample.java so it has my accessKey and secret
accessKey

3) Compiled the test project (No problems here)

4) Ran test project:

java EnqueueSample queue1 message1


And...

I get the following error:

[ERROR] EnqueueSample - EXCEPTION
<com.xerox.amazonws.sqs.SQSException: Connecti
on refused: connect>com.xerox.amazonws.sqs.SQSException: Connection
refused: con
nect
at
com.xerox.amazonws.sqs.QueueService.listMessageQueues(QueueService.ja
va:177)
at
com.xerox.amazonws.sqs.SQSUtils.getMessageQueue(SQSUtils.java:104)
at
com.xerox.amazonws.sqs.SQSUtils.connectToQueue(SQSUtils.java:63)
at EnqueueSample.main(EnqueueSample.java:33)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:
333)
at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.Socket.connect(Socket.java:520)
at java.net.Socket.connect(Socket.java:470)
at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:387)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:522)
at
sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:278)
at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:
335)
at
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewH
ttpClient(AbstractDelegateHttpsURLConnection.java:172)
at
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConne
ction.java:765)
at
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect
(AbstractDelegateHttpsURLConnection.java:158)
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
nection.java:934)
at
sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Http
sURLConnectionImpl.java:234)
at
com.xerox.amazonws.sqs.QueueService.listMessageQueues(QueueService.ja
va:157)
... 3 more


Could you please help? Thanks

David Kavanagh

unread,
Nov 30, 2007, 7:57:53 AM11/30/07
to typ...@googlegroups.com
Are you behind a firewall?

       at java.net.PlainSocketImpl.socketConnect (Native Method)

       at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:
333)
       at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
       at java.net.PlainSocketImpl.connect (PlainSocketImpl.java:182)

dkav...@gmail.com

unread,
Nov 30, 2007, 7:58:57 AM11/30/07
to typica
Oh, and by firewall, I really meant "proxy". Sorry about that.

David

On Nov 30, 7:57 am, "David Kavanagh" <dkavan...@gmail.com> wrote:
> Are you behind a firewall?
>
> > at java.net.PlainSocketImpl.socketConnect(Native Method)
> > at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:
> > 333)
> > at
> > java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> > at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)

Tamara

unread,
Nov 30, 2007, 8:33:14 AM11/30/07
to typica
None that I know of ...
> > > Could you please help? Thanks- Hide quoted text -
>
> - Show quoted text -

dkav...@gmail.com

unread,
Nov 30, 2007, 12:55:56 PM11/30/07
to typica
Did you modify the java code to set your access id and secret key? I'd
expect a different message if so, but thought I'd ask.
Also, can you telnet to that server? Try "telnet queue.amazonaws.com
80". If you get a connection, that means you're connection to the
server is good.

David

Tamara

unread,
Dec 1, 2007, 1:49:12 PM12/1/07
to typica
I did modify the access id and secret access id. and I was also able
to connect with telnet. I'm really stumped!
I appreciate your help. I need to get this going.

David Kavanagh

unread,
Dec 1, 2007, 1:52:20 PM12/1/07
to typ...@googlegroups.com
Would you mind sending me the Java code? I promise, I won't abuse your login! (just mail it to my gmail, not the forum!)

David

> > > > >        at sun.net.NetworkClient.doConnect (NetworkClient.java:157)

Tamara

unread,
Dec 5, 2007, 10:35:07 PM12/5/07
to typica
Just to conclude:

Thanks to David, I removed "localhost" from this line of code:

MessageQueue msgQueue = SQSUtils.connectToQueue(localhost,queueName,
AWSAccessKeyId, SecretAccessKey);

And got rid of the error.

On Dec 1, 10:52 am, "David Kavanagh" <dkavan...@gmail.com> wrote:
> Would you mind sending me the Java code? I promise, I won't abuse your
> login! (just mail it to my gmail, not the forum!)
>
> David
>
Reply all
Reply to author
Forward
0 new messages