I am kind of new to this library. I read thru the stuff and it seems
wonderful. I tried using in my PC. I have a tomcat server and have
included the necessary jars and dependency. But when I try to run ur
enque sample code I get the following errors
SEVERE: EXCEPTION
com.xerox.amazonws.sqs.SQSException: Remote host closed connection
during handshake
at
com.xerox.amazonws.sqs.QueueService.listMessageQueues(QueueService.java:
177)
at com.xerox.amazonws.sqs.SQSUtils.getMessageQueue(SQSUtils.java:104)
at com.xerox.amazonws.sqs.SQSUtils.connectToQueue(SQSUtils.java:63)
at com.EnqueTypicaSample.main(EnqueTypicaSample.java:33)
Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed
connection during handshake
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:
742)
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:
1030)
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:
1057)
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:
1041)
at
sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:
402)
at
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:
170)
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:
938)
at
sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:
234)
at
com.xerox.amazonws.sqs.QueueService.listMessageQueues(QueueService.java:
157)
... 3 more
Caused by: java.io.EOFException: SSL peer shut down incorrectly
at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:
333)
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:
723)
... 11 more
I am using the eclipse IDE. Please help me out where I am going wrong.
Thanking you in anticipation.
Dharmesh
> sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Abstrac...
> 170)
> at
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection....
> 938)
> at
> sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConn...
Regards
Dharmesh
On Aug 23, 5:31 am, "dkavan...@gmail.com" <dkavan...@gmail.com> wrote:
> I'm scratching my head on this one. Which version of the JDK are you
> using? Have you tried running outside of eclipse?
>
> On Aug 22, 12:50 am, Dharmesh <vaghan...@gmail.com> wrote:
>
>
>
> > Hello,
>
> > I am kind of new to this library. I read thru the stuff and it seems
> > wonderful. I tried using in my PC. I have a tomcat server and have
> > included the necessary jars and dependency. But when I try to run ur
> > enque sample code I get the following errors
>
> > SEVERE: EXCEPTION
> > com.xerox.amazonws.sqs.SQSException: Remote host closed connection
> > during handshake
> > at
> > com.xerox.amazonws.sqs.QueueService.listMessageQueues(QueueService.java:
> > 177)
> > at com.xerox.amazonws.sqs.SQSUtils.getMessageQueue(SQSUtils.java:104)
> > at com.xerox.amazonws.sqs.SQSUtils.connectToQueue(SQSUtils.java:63)
> > at com.EnqueTypicaSample.main(EnqueTypicaSample.java:33)
> > Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed
> > connection during handshake
> > at
> > com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:
> > 742)
> > at
> > com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:
> > 1030)
> > at
> > com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:
> > 1057)
> > at
> > com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:
> > Dharmesh- Hide quoted text -
>
> - Show quoted text -
Also, I am trying to open the URL "http://queue.amazonaws.com/" but in
my browser it shows ..Bad request ..
Regards,
Dharmesh
> > - Show quoted text -- Hide quoted text -
Can you run "traceroute queue.amazonaws.com" ?
One simple thing to try would be some of the test code I have on the
typica wiki. Nothing fancy happening there. You'd run it as a
standalone app, either inside your IDE or not, but it wouldn't require
a web container.
David
Thanks for the guidance.. I tried that sample code both within and
without the IDE .. but get the same error as
"com.xerox.amazonws.sqs.SQSException: Connection refused: connect .."
Also I wanted to know the difference in the
code snippet shown in the wiki and that of the code shown in the link
above the snippet.. One shows the use of "localhost" and other doesnt.
Can you please also clarify what is the difference and whether its
essential or not. I will
try to run the code having unrestrice internet access and let u know
whether the problem still persist..
Regards
Dharmesh
David
I figured it out .. I guess it wasnt working because of some firewall
and proxy.. Thanks for your help :)
Also can you please tell me how I can find out whether a queue already
exists while creating it .. I have used
SQSUtils.getMessageQueue() but it returns an object of the queue if
already existing and if the queue is not existing it also returns a
queue object but after creating one .. It means it never returns a
null value for me to check whether the queue is existing .. Please
tell me where am I going wrong ..
Regards
Dharmesh
As far as testing to see if a queue is created, You'll simply have to
do that manually. There isn't any method in the SQS API that provides
that, so you'll need to call QueueService.listMessageQueues(String
prefix) and look through that list.
David
Well I tried to work on an unrestricted net without ne proxy, so it
works. Now I am making a web application where the user will enter the
details which will be tossed in the queue. I use tomcat server and
when I try to access it I am getting it
java.lang.RuntimeException: Could not find sha1 algorithm
at com.xerox.amazonws.common.AWSConnection.encode(AWSConnection.java:
145)
at
com.xerox.amazonws.common.AWSQueryConnection.makeRequest(AWSQueryConnection.java:
103)
at
com.xerox.amazonws.sqs.QueueService.listMessageQueues(QueueService.java:
157)
at com.xerox.amazonws.sqs.SQSUtils.getMessageQueue(SQSUtils.java:104)
at MessageProcessor.RecieveAllMessages.<init>(RecieveAllMessages.java:
33)
at
org.apache.jsp.PendingApprovals_jsp._jspService(PendingApprovals_jsp.java:
97)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:
328)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:
315) ....
It works fine on a stand alone application. I have also included the
necessary jar files in the lib folder of tomcat webapps
Please help me out in determining what must be wrong
Regards,
Dharmesh
Also I thought that using SQSUtils.connectToQueue .. I can specify the
tomcat server as "localhost" but it gives an error as handhake
refused .. Please help me out .. I have to access my SQS thru Tomcat
as its a web application also I checked
String ext = System.getProperty("java.ext.dirs");
System.out.println("java.ext.dirs=" + ext);
to see whether its pointing to the directory where sunjce_provider.jar
is present and it does point to it ..
Please help me as soon as possible.
Regards
Dharmesh
David
> ...
>
> read more »
Actually I am trying to develop a web application where the users can
register themselves and the registered details will be then tossed in
the queue. For that purpose I have developed a html page which then
calls the servlet hosted in tomcat which then interacts with the SQS
for inserting in the queue .. The problem that I am facing is the
stand alone application works fine. But when I try through an servlet
it gives an error as "could not find sha1 algorithm" ...
Hope I have made myself some what clear. Please help me out
Dharmesh
> ...
>
> read more »
David
> ...
>
> read more »
Alternately you should probably think about putting all your SQS code
into servlets rather than JSPs and have your pages be very simple ones
that trigger the servlet to do the real work. I have found that the
less code you have in your JSPs the simpler your life will be.