Free Support Forum - aspose.com

Connection refused exception occurred during OCR process

I want to read a text from an Image using java. I went though your sample but I am getting exception in connect can you tell me what I have to do?

EXTRACT TEXT FROM IMAGES USING JAVA REST
http://saaspose.com/docs/display/ocr/How+to+Extract+Text+from+Image+(Java+REST)

java.net.ConnectException: Connection refused: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(Unknown Source) at java.net.PlainSocketImpl.connectToAddress(Unknown Source) at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.SocksSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at java.net.Socket.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.http.HttpClient.(Unknown Source) at sun.net.www.http.HttpClient.New(Unknown Source) at sun.net.www.http.HttpClient.New(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source) at ExtractTextFromImages.ExtractTextFromImages.UploadFileBinary(ExtractTextFromImages.java:161) at ExtractTextFromImages.ExtractTextFromImages.main(ExtractTextFromImages.java:61) File uploaded successfully Reading image text … Connection refused: connect


Submitted from: http://saaspose.com/

Hi Sanyashi,

Thank you for your inquiry. Could you please recheck the sample code at http://saaspose.com/docs/display/ocr/How+to+Extract+Text+from+Image+%28Java+REST%29 ? Because I did not observe any problem with this sample code on my side. May be it is due to some network issue. Please also share the image file here in this thread for testing purposes.

Best Regards,
Imran Rafique
Support Developer, Saaspose Sialkot Team
http://www.saaspose.com

Hi Sanyashi,

Is this issue resolved at your end? Have you been able to continue with your testing? If you need any further assistance, please do let us know. We'll be glad to help you.

Thanks & Regards
Shahzad Latif
Saaspose Support Team.