×

Discussion Board

Results 1 to 14 of 14
  1. #1
    Registered User
    Join Date
    Mar 2013
    Posts
    21

    Connection Exception in j2me app via httpconnection

    i am developing a j2me application on lbs it work fine in emulator but it giving java.io.ioexception -1 in Nokia N97mini. So please help me about this its urgent please

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

    Re: Connection Exception in j2me app via httpconnection

    We need more information. As I asked in my response when you posted this problem originally:

    Can you tell is the URL? Or at least, as much detail about the URL as possible? (protocol, port, query string, etc.)

    Can you open the same URL in the device's browser, connecting to the internet by the same mechanism (wifi, cellular, same access point, etc.)?

    Can you open an HttpConnection to somewhere else (like "www.google.com") and get a response (probably a 302 in this case)?

    Since you say this is urgent, some advice for getting faster and better replies:

    1. Start a new thread (as you have done) rather than tag on to the end of an existing thread.
    2. Don't post the question in more than one place.
    3. Give as much detail as possible - small pieces of code are good, but please not your entire application.

    Graham.

  3. #3
    Registered User
    Join Date
    Mar 2013
    Posts
    21

    Re: Connection Exception in j2me app via httpconnection

    this is my code where i am getting the exception


    String url="http://locate.phpzilla.net/mytest.php";
    HttpConnection httpConn = null;
    try{
    httpConn = (HttpConnection)Connector.open(url);

    if(httpConn.getResponseCode() == HttpConnection.HTTP_OK){
    StringItem si = new StringItem(null, "connected");
    si.setLayout(Item.LAYOUT_NEWLINE_AFTER);
    form.append(si);

    }
    } catch (Exception e) {
    StringItem si = new StringItem(null, e.toString());
    si.setLayout(Item.LAYOUT_NEWLINE_AFTER);
    form.append(si);
    }
    finally{ // Clean up
    try{
    if(httpConn != null)
    httpConn.close();
    }
    catch(Exception e){}
    }

    and i also tried for google.com it also gives same exception
    Last edited by lbstracker; 2013-03-22 at 19:30.

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

    Re: Connection Exception in j2me app via httpconnection

    OK, no problem with the code or the server. The problem is with the phone's network connection (or configuration).

    Quote Originally Posted by grahamhughes View Post
    Can you open the same URL in the device's browser, connecting to the internet by the same mechanism (wifi, cellular, same access point, etc.)?
    Would be useful to know.

    Also: does the device prompt you to select an access point before you see the error?

    Are you using wifi or cellular connection?

    Graham.

  5. #5
    Registered User
    Join Date
    Mar 2013
    Posts
    21

    Re: Connection Exception in j2me app via httpconnection

    i am using cellular connection, and my device does not prompt any access point selection

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

    Re: Connection Exception in j2me app via httpconnection

    And the device's browser? Does it reach the URL?

  7. #7
    Registered User
    Join Date
    Mar 2013
    Posts
    21

    Re: Connection Exception in j2me app via httpconnection

    the web address (http://locate.phpzilla.net/mytest.php) i opening in my app is also not opening in device browser. and from server page i just echo "connected" to check it is connecting or not
    Last edited by lbstracker; 2013-03-22 at 19:26.

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

    Re: Connection Exception in j2me app via httpconnection

    OK. Sounds like your phone has no internet connection configured.

    Contact your network operator to get the correct settings sent to your phone.

    Graham.

  9. #9
    Registered User
    Join Date
    Mar 2013
    Posts
    21

    Re: Connection Exception in j2me app via httpconnection

    sorry my device browser reach this url now

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

    Re: Connection Exception in j2me app via httpconnection

    OK... and I notice you've changed the URL in your two previous posts.

    I take it the app still cannot access this URL?

    OK. Go to Settings, Application Manager, Installed Apps, (your app), Options, Suite Settings, Access Point. Make sure a suitable access point is selected. If there aren't any access points, you need one (network operator again). If one doesn't work, try another.

    Graham.

  11. #11
    Registered User
    Join Date
    Mar 2013
    Posts
    21

    Re: Connection Exception in j2me app via httpconnection

    sorry for editing, i mistakenly typed that so i changed it, and my application is now working. thank you very much for your kind help

  12. #12
    Registered User
    Join Date
    Mar 2013
    Posts
    21

    Re: Connection Exception in j2me app via httpconnection

    Quote Originally Posted by grahamhughes View Post
    OK. Go to Settings, Application Manager, Installed Apps, (your app), Options, Suite Settings, Access Point. Make sure a suitable access point is selected. If there aren't any access points, you need one (network operator again). If one doesn't work, try another.

    Graham.
    I need to know how i directly get the default access point for my app

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

    Re: Connection Exception in j2me app via httpconnection

    I'm not sure what that means. What do you want to do?

  14. #14
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: Connection Exception in j2me app via httpconnection

    Quote Originally Posted by lbstracker View Post
    I need to know how i directly get the default access point for my app
    check this wiki article http://www.developer.nokia.com/Commu...Points_in_J2me, this will give you a list of access points available on your device.

Similar Threads

  1. NullPointer Exception for J2ME HTTPConnection to asp server
    By mbilal3 in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2011-05-30, 13:18
  2. NullPointer Exception for J2ME HTTPConnection to asp server
    By mbilal3 in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2011-05-20, 11:22
  3. J2me MIDlet to Servlet HttpPost connection Exception java.io.EOFException
    By sumanbera in forum Mobile Java Tools & SDKs
    Replies: 5
    Last Post: 2008-01-11, 12:29
  4. gettin exception when making httpconnection
    By kunal_the_one in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2004-07-08, 06:57
  5. 7650 exception in HttpConnection.openInputStr eam
    By sameer_manuja in forum Mobile Java General
    Replies: 0
    Last Post: 2002-09-19, 11:04

Posting Permissions

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