×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Dec 2012
    Location
    Mumbai, Maharashtra, India
    Posts
    79

    Question Google Static Map API error - java.io.IOException : No Response Entries Available

    I am Developing GPS based app in J2me . I am new in the Google API coding. When I give command to map on after another for example Up, Down, zoom, zoom-out, the Google Static Map API gives me the two error on two different emulators at this code - inputStream = connection.openInputStream(); :-

    (When using Nokia SDK 1.0 or 2.0)
    java.io.IOException: No Response Entries Available
    null
    at com.sun.midp.io.InternalConnector.openPrim(+157)
    at com.sun.midp.io.InternalConnector.openInternal(+9)
    at com.sun.midp.io.j2me.http.Protocol.connect_wap(+210)
    at com.sun.midp.io.j2me.http.Protocol.connect(+107)
    at com.sun.midp.io.j2me.http.Protocol.openInputStream(+64)
    at midletgps.GoogleMaps.run(GoogleMaps.java:90)
    What is the meaning of this error & how should I resolved that?? Plz help me.. I stucked here because of this problem...

    (When using Oracle emulator 3.0.5)
    java.io.IOException: Resource limit exceeded for TCP client sockets
    at com.sun.midp.io.j2me.socket.Protocol.open0(), bci=0
    at com.sun.midp.io.j2me.socket.Protocol.connect(), bci=169
    at com.sun.midp.io.j2me.socket.Protocol.open(), bci=133
    at com.sun.midp.io.j2me.socket.Protocol.openPrim(), bci=4
    at com.sun.midp.io.j2me.http.Protocol.createConnection(), bci=13
    at com.sun.midp.io.j2me.http.Protocol.connect(), bci=43
    at com.sun.midp.io.j2me.http.Protocol.streamConnect(), bci=109
    at com.sun.midp.io.j2me.http.Protocol.startRequest(), bci=9
    at com.sun.midp.io.j2me.http.Protocol.sendRequest(), bci=35
    at com.sun.midp.io.j2me.http.Protocol.sendRequest(), bci=3
    at com.sun.midp.io.j2me.http.Protocol.openInputStream(), bci=6
    - midletgps.GoogleMaps.run(GoogleMaps.java:90)
    at java.lang.Thread.run(Thread.java:619)

    My connection code is as follows :

    //the query string for the Google service

    String url = "http://maps.google.com/maps/api/staticmap?center=";
    url += latitude + "," + longitude;
    url += "&zoom=" + String.valueOf(zoom);
    url += "&size=" + width + "x" + height + "&maptype=hybrid" +"&sensor=true" + "&key=API key";
    try
    {
    connection = (HttpConnection)Connector.open(url);
    connection.setRequestMethod(HttpConnection.GET);
    inputStream = connection.openInputStream();
    map = Image.createImage(inputStream);
    setImage(map);
    iserror=false;
    repaint();
    midGPS.displayMap();
    }
    catch (Exception ex)
    {
    iserror=true;
    ex.printStackTrace();
    }
    finally
    {
    try
    {
    if (connection != null)
    {
    connection.close();
    }
    }
    catch (Exception ex)
    {
    ex.printStackTrace();
    }
    }

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,734

    Re: Google Static Map API error - java.io.IOException : No Response Entries Available

    You may want to print the resulting URL out and check it with a browser.
    Side remark: I hope "key=API key" is a placeholder for a real key.

  3. #3
    Registered User
    Join Date
    Dec 2012
    Location
    Mumbai, Maharashtra, India
    Posts
    79

    Re: Google Static Map API error - java.io.IOException : No Response Entries Available

    Quote Originally Posted by wizard_hu_ View Post
    You may want to print the resulting URL out and check it with a browser.
    Side remark: I hope "key=API key" is a placeholder for a real key.
    URL showing image in browser.....

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,734

    Re: Google Static Map API error - java.io.IOException : No Response Entries Available

    Try the other things from the StackOverflow question, http://stackoverflow.com/questions/1...tries-availabl, the getResponseCode/Message is certainly a good idea.

  5. #5
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105

    Re: Google Static Map API error - java.io.IOException : No Response Entries Available

    Rahul, in such a case, I would go for Wireshark. It captures the data traffic. And you are lucky because this happens in the emulator as well. Perhaps you have a cookie or an OAuth issue. Wireshark will show the difference. Then, when you deploy your MIDlet to a real phone, I recommend to go for a Nokia with WLAN. With that, you are able to capture the WLAN traffic and therefore the HTTP traffic.

Similar Threads

  1. IOException java.io.IOException: 40-Error in HTTP operation
    By @RainierLabs in forum Mobile Java General
    Replies: 2
    Last Post: 2011-05-06, 14:23
  2. Error opening google maps url (static api)
    By puller86 in forum Mobile Java Networking & Messaging & Security
    Replies: 4
    Last Post: 2010-06-27, 21:52
  3. java io IOException error 20
    By shanklin in forum Mobile Java General
    Replies: 6
    Last Post: 2010-04-29, 16:44
  4. java.io.IOException: Out of response entries in 6300
    By mtuhukumar k in forum Mobile Java Networking & Messaging & Security
    Replies: 16
    Last Post: 2009-10-12, 10:56
  5. Replies: 16
    Last Post: 2005-08-01, 11:02

Posting Permissions

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