×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    Registered User
    Join Date
    Mar 2006
    Posts
    9

    java.io.IOException: Error in HTTP operation

    hai

    My Application is working fine in emulator and working fine under Via OTA and also works fine in Nokia 7210 ,but i install in Nokia 6230i i got the error java.io.IOException: Error in HTTP operation,when i type the same url in Nokia 6230i browser the result came back from the server ,only in application its not working ,plese help me regarding this , what is the problem

    my code for Http Connection

    System.out.println("in here");
    HttpConnection c = null;
    InputStream is = null;
    try
    {
    System.out.println("in try");
    c=(HttpConnection)Connector.open(url);
    c.setRequestMethod(HttpConnection.GET);
    c.setRequestProperty("User-Agent", "Profile/MIDP-2.0 Configuration/CLDC-1.0");
    c.setRequestProperty("Content-Language", "en-US");
    System.out.println("after passing url");
    int rc = c.getResponseCode();
    if (rc != HttpConnection.HTTP_OK)
    {
    throw new IOException("HTTP response code: " + rc);
    }
    System.out.println("after responce");
    is = c.openInputStream();
    ByteArrayOutputStream bin = new ByteArrayOutputStream();
    byte[] buffer = new byte[3000];
    int rd;
    while ( (rd=is.read(buffer))!= -1)
    {
    bin.write(buffer,0,rd);
    }
    System.out.println("after getting data");
    bin.flush();
    return bin.toString();
    }

    Thanks & regards
    Ravi varma

  2. #2
    Registered User
    Join Date
    Apr 2006
    Posts
    4

    Re: java.io.IOException: Error in HTTP operation

    You may have a similar problem like mine. The Wap browser uses a different access point than the j2me app. I figured out that j2me apps on my 6021 (and a 6230i too) uses the primary access point. In my case, j2me apps can access the net only through a proxy, but there is no possibility to enter the proxy address at the editing of a simple access point.

  3. #3
    Registered User
    Join Date
    Aug 2006
    Posts
    2

    Re: java.io.IOException: Error in HTTP operation

    Hello, I'm running into the same problem (error in http operation), my midlet works with a 5140 but not with a 5140i. Do you know where to specify the access point parameters for j2me apps?

  4. #4
    Super Contributor
    Join Date
    Dec 2005
    Location
    Europe/Poland/Warsaw
    Posts
    1,697

    Re: java.io.IOException: Error in HTTP operation

    Quote Originally Posted by mauron
    Do you know where to specify the access point parameters for j2me apps?
    you usually shouldn't do any changes, just request access points settings via OTA download from your operator (data carrier),
    and use the same ap name that used for internet connections once prompted in your application,

    hth,
    regards,
    peter

  5. #5
    Registered User
    Join Date
    Aug 2006
    Posts
    2

    Re: java.io.IOException: Error in HTTP operation

    Thanks for your help. In fact, my operator parameters did not include the "Access Point" profile. I had to create it manually. But now everything works. Thanks again!

  6. #6
    Registered User
    Join Date
    Oct 2006
    Posts
    5

    Re: java.io.IOException: Error in HTTP operation

    Quote Originally Posted by mauron
    Thanks for your help. In fact, my operator parameters did not include the "Access Point" profile. I had to create it manually. But now everything works. Thanks again!
    Hi friends,
    I have the same problem, please can you tell me how can i create a "Access point" profile.. Thanks
    Saludos,

    Ricardo Tituaña.
    Home-phone: 593 22320992
    Cell-phone: 593 96231186
    E-mail: xnio@msn.com

  7. #7
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: java.io.IOException: Error in HTTP operation

    You should be able to get the network connection working by following these instructions
    https://blogs.forum.nokia.com/view_entry.html?id=282

    Hartti

  8. #8
    Registered User
    Join Date
    Oct 2006
    Posts
    5

    Angry Re: java.io.IOException: Error in HTTP operation

    The problem is my data carrier did´nt give a Access Point name, may be, because they don´t have, and If they don´t have... Anyone can tell me to do???
    Saludos,

    Ricardo Tituaña.
    Home-phone: 593 22320992
    Cell-phone: 593 96231186
    E-mail: xnio@msn.com

  9. #9
    Super Contributor
    Join Date
    Dec 2005
    Location
    Europe/Poland/Warsaw
    Posts
    1,697

    Re: java.io.IOException: Error in HTTP operation

    hi Ricardo,
    go to your Nokia regional site, select your phone model,
    find section "order settings",
    e.g. see that page for 6270:
    http://europe.nokia.com/A4144805
    follow step by step instruction to request basic settings to your phone via sms,
    hth,
    regards,
    Peter

  10. #10
    Registered User
    Join Date
    Oct 2006
    Posts
    5

    Unhappy Re: java.io.IOException: Error in HTTP operation

    Quote Originally Posted by peterblazejewicz
    Super Contributor
    hi Ricardo,
    go to your Nokia regional site, select your phone model,
    find section "order settings",
    e.g. see that page for 6270:
    http://europe.nokia.com/A4144805
    follow step by step instruction to request basic settings to your phone via sms,
    hth,
    regards,
    Peter
    Hello peterblazejewicz,
    I did that, i didn´t find my country, I am from Ecuador, my carrier is Telefonica Movistar.
    Saludos,

    Ricardo Tituaña.
    Home-phone: 593 22320992
    Cell-phone: 593 96231186
    E-mail: xnio@msn.com

  11. #11
    Registered User
    Join Date
    Nov 2008
    Posts
    11

    Re: java.io.IOException: Error in HTTP operation

    Hi,
    I have been using the following code, (to read text file using httpConnection), it is working fine with nokia N73(S60 ),
    But when executing in S40(nokia 5220,6070) Phones it is throwing an exception stating
    "java.io.IOException:Error in HTTP operation"

    and it is displaying "ResponseCode of 0";

    Could any body please help me,

    //Code

    private void getViaStreamConnection(String url) throws IOException {

    System.out.println("in here");
    HttpConnection c = null;
    InputStream is = null;

    int rc=0;
    try
    {
    System.out.println("in try");
    c=(HttpConnection)Connector.open(url);
    c.setRequestMethod(HttpConnection.GET);
    c.setRequestProperty("User-Agent", "Profile/MIDP-2.0 Configuration/CLDC-1.1");
    c.setRequestProperty("Content-Language", "en-US");
    System.out.println("after passing url");
    form1.append("afetr passing url \n");

    rc = c.getResponseCode();

    if (rc != HttpConnection.HTTP_OK)
    {
    throw new IOException("HTTP response code: " + rc);
    }
    form1.append("after response");
    System.out.println("after responce");
    is = c.openInputStream();
    ByteArrayOutputStream bin = new ByteArrayOutputStream();
    byte[] buffer = new byte[3000];
    int rd;
    while ( (rd=is.read(buffer))!= -1)
    {
    bin.write(buffer,0,rd);
    }
    System.out.println("after getting data");
    bin.flush();

    form1.append("response is :"+rc);
    form1.append(bin.toString());
    display1.setCurrent(form1);

    }
    catch(Exception e)
    {
    form1.append("response is :"+rc+"exception: "+e);
    display1.setCurrent(form1);

    }
    }

    Thanku Regards,
    chandu.

  12. #12
    Registered User
    Join Date
    Apr 2011
    Posts
    1

    Post Re: java.io.IOException: Error in HTTP operation

    helllllllllllllllllllllllllppppppppppppppppppp

  13. #13
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: java.io.IOException: Error in HTTP operation

    Welcome to Forum Nokia!

    Can you be any more specific? The more you can tell us, the more we can help.

    Graham.

  14. #14
    Registered User
    Join Date
    May 2011
    Posts
    2

    Re: java.io.IOException: Error in HTTP operation

    Hi all..
    I have Some Problem.
    I have Phone: Nokia C3-00 and when i'm going to enter in Internet: b03
    java.io.IOException : Error in HTTP operation

    Pls Help me..
    I don't know what to do.

    Sry, i don't know so good English Language.

  15. #15
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: java.io.IOException: Error in HTTP operation

    Quote Originally Posted by ghitakerekes View Post
    Hi all..
    I have Some Problem.
    I have Phone: Nokia C3-00 and when i'm going to enter in Internet: b03
    java.io.IOException : Error in HTTP operation

    Pls Help me..
    I don't know what to do.

    Sry, i don't know so good English Language.
    Can you access GPRS from any MIDlets other than yours? If not, then it sounds very much like a GPRS settings problem.

    If I remember correctly, S40 handsets have a Streaming settings option in the settings menu. Ensure you've created a GPRS access point which is referenced in the streaming settings option.

    This might be of some help.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

Similar Threads

  1. Error in HTTP operation
    By fethy in forum Mobile Java General
    Replies: 10
    Last Post: 2007-08-30, 11:53
  2. Replies: 2
    Last Post: 2006-10-06, 17:24
  3. error in http operation on 6822
    By samy_rdissi in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2005-06-28, 17:23
  4. http connection throws java.io.IOException: Status=-20
    By adiwin in forum Mobile Java General
    Replies: 3
    Last Post: 2003-03-17, 11:21

Posting Permissions

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