Results 1 to 2 of 2
  1. #1
    phoenixx is offline Member
    Join Date
    Jan 2014
    Posts
    1
    Rep Power
    0

    Default error 503 while tring to access a site repeatedly in Java

    There is an online dictionary for English-Bengali(an Indian Language) word translation. I have some text in English and want to find Bengali translation of each English word through Java programming. My code is working but after some time ie. after processing 1 or 2 sentences its returning a HTTP 503 error. After I rerun its giving the error from the beginning!! I thought that that the server might have got overloaded as I am accessing continuously so I put a Thread.sleep((5000) in it to pause for 5 secs but the problem still persists!! Please someone help as soon as possible!
    I am providing the method where I am actually doing the html reading and extracting the Bengali word from it:
    view source
    print?
    01 public void printword(String str)throws Exception{//str is the English word
    02 try{
    03 Thread.sleep(5000);
    04 }catch(Exception e){
    05 System.out.println(e);
    06 }
    07 System.out.println("print"+str);
    08 URL oracle = new URL("http://www.bengalinux.org/cgi-bin/abhidhan/index.pl?en_word="+str+"&lookupbtn=Look+it+up+%3A% 3A+%E0%A6%85%E0%A6%A8%E0%A7%81%E0%A6%B8%E0%A6%A8%E 0%A7%8D%E0%A6%A7%E0%A6%BE%E0%A6%A8+%E0%A6%95%E0%A6 %B0%E0%A7%8B");
    09 BufferedReader in = new BufferedReader(new InputStreamReader(oracle.openStream()));
    10 boolean flag=true;
    11 boolean f1=false;//it checks whether a Bengali trans exist as "dict_entry tag will not be present then
    12 String inputLine;
    13 while ((inputLine = in.readLine()) != null){
    14 if(inputLine.indexOf("dict_entry")>=0&&flag){//the translated word exists in the dict_entry tag
    15
    16 f1=true;
    17 for(int i=0;i<inputLine.length();i++){
    18 if(inputLine.charAt(i)>=2432){//checking for bengali character
    19 pout.print(inputLine.charAt(i));
    20 flag=false;
    21
    22 }
    23 }
    24
    25 }
    26 }
    27 if(!f1){//here i am just printing an underline if there is no Bengali translation of the english word
    28 pout.print("______");
    29 }
    30 System.out.println("done:"+str);
    31
    32 //pout.println(inputLine);
    33 in.close();
    34 }

  2. #2
    wsaryada is offline Senior Member
    Join Date
    Jun 2007
    Location
    Bali, Indonesia
    Posts
    760
    Rep Power
    8

    Default Re: error 503 while tring to access a site repeatedly in Java

    HTTP errpr 503 means that the service is not available, maybe the server was down at the time you were accessing it.

Similar Threads

  1. Replies: 12
    Last Post: 10-04-2012, 10:40 AM
  2. Cannot access Revenue site requiring Java applet
    By woody60 in forum Java Applets
    Replies: 2
    Last Post: 09-01-2012, 01:16 AM
  3. Replies: 1
    Last Post: 06-08-2012, 08:11 AM
  4. Replies: 1
    Last Post: 07-12-2011, 02:02 PM
  5. Replies: 8
    Last Post: 06-15-2011, 06:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •