×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    Registered User
    Join Date
    May 2013
    Location
    Manaus, Brazil
    Posts
    9

    Some HTTPConnection requests not working on Asha SDK 1.0

    Hi all,

    We are making a product for both Asha QWERTY (SDK 1.1) and Fulltouch (SDK 2.0) devices. With the release of the Beta SDK for Asha 1.0 devices (Namely, Asha 501), I decided to test our common code (shared between QWERTY and FT) in the new SDK.

    All unit tests pass, except from some specific HTTPConnection requests. The error is the following:

    java.io.IOException: Unknown error -1 during socket::read

    Those same errors don't occur at all on 1.1 and 2.0 emulators. It's also worth noting that it does not happen on every HTTPConnection request, only on some specific services we are fetching from (Nokia Places API is one of them).

    Does anybody have a clue on this?

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

    Re: Some HTTPConnection requests not working on Asha SDK 1.0

    If you have the time and the mood, you may consider comparing the successful/unsuccessful communication attempts with some network monitoring/analyzer tool (like Wireshark).

  3. #3
    Registered User
    Join Date
    May 2013
    Location
    Manaus, Brazil
    Posts
    9

    Re: Some HTTPConnection requests not working on Asha SDK 1.0

    Hi wizard_hu,

    Actually, I did!

    There is no difference in the server response among the three emulators, and the only difference between sucessful and failed requests is that the lenght of the response is -1 on those who failed on Asha 1.0.
    Well, -1 is a totaly valid response when the server don't tell the total size of the response. And SDKs 1.1 and 2.0 does handle it with no problems.

    I'm starting to think this is a platform bug for Asha 1.0. I guess when you're a beta user, that comes with the package, right?

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

    Re: Some HTTPConnection requests not working on Asha SDK 1.0

    Thank you very much for doing the check.
    Yes, it can be a beta effect. Apparently HTTPConnection has a new implementation then. With a brand new bug, apparently. I have no idea why (disclaimer: moderators on this site are enthusiast 3rd-party volunteers).
    Does the SDK say something about bug reports? It would be very nice from you to report it. If there is nothing specified for this particular SDK, the general report page is http://www.developer.nokia.com/bugs/, I guess this one could be listed as "Series 40" (as there is no Asha yet), "Java" ("Connectivity" seems to be about various bearers to me).

  5. #5
    Registered User
    Join Date
    May 2013
    Location
    Manaus, Brazil
    Posts
    9

    Re: Some HTTPConnection requests not working on Asha SDK 1.0

    Hey wizard_hu_

    I just filed a bug on the bug database: http://www.developer.nokia.com/bugs/...ug.cgi?id=1221

    Thanks for your help. I'll update this thread when a solution is found.

  6. #6
    Registered User
    Join Date
    Feb 2011
    Posts
    62

    Re: Some HTTPConnection requests not working on Asha SDK 1.0

    Thanks for this cavalcanti.luiz, well spotted!

  7. #7
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    686

    Re: Some HTTPConnection requests not working on Asha SDK 1.0

    Wizard: how do you know there is a new HTTPConnection implementation? is it only limited to the emulator or the device as well?
    if this is a real bug and is also on the device jvm then i think this is very bad and should be top priority

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

    Re: Some HTTPConnection requests not working on Asha SDK 1.0

    Luiz, please attach a sample project to that bug which is trim down version of your MIDlet and contains only the HTTP code. Furthermore, please append at least one Wireshark log stripped to the HTTP messages. Finally, include the HTTP response, as it is plain text, this should be no problem. I do not get what is -1 and I do not think the one who is reviewing this bug will either.
    Last edited by traud; 2013-05-20 at 18:05.

  9. #9
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,694

    Re: Some HTTPConnection requests not working on Asha SDK 1.0

    Quote Originally Posted by shai.i View Post
    Wizard: how do you know there is a new HTTPConnection implementation?
    I do not know, it is my assumption. Something must have been altered. The Java code in question is said to be unmodified. Layers below HTTP seem to work in general, as other HTTP requests work. So assuming a change in HTTPConnection may have some ground.
    is it only limited to the emulator or the device as well?
    One would need an actual device to test. Ask MTron, in the Champ board he suggests he is using an actual 501.
    if this is a real bug and is also on the device jvm then i think this is very bad and should be top priority
    No ideas from my side. The only thing which may be worth mentioning is that -1 is not a valid Content-Length value, it is expected to be non-negative.

  10. #10
    Registered User
    Join Date
    May 2013
    Location
    Manaus, Brazil
    Posts
    9

    Re: Some HTTPConnection requests not working on Asha SDK 1.0

    Quote Originally Posted by wizard_hu_ View Post
    I do not know, it is my assumption. Something must have been altered. The Java code in question is said to be unmodified. Layers below HTTP seem to work in general, as other HTTP requests work. So assuming a change in HTTPConnection may have some ground.One would need an actual device to test. Ask MTron, in the Champ board he suggests he is using an actual 501.No ideas from my side. The only thing which may be worth mentioning is that -1 is not a valid Content-Length value, it is expected to be non-negative.
    Wizard is right, according to the HTTP specification, a "Content-Lenght" with value equals to -1 is not valid. Anyway, it works on previous devices and emulators.

    About the Emulator x Device question, yes, the error occurs in both. And I'm sure I have the latest firmware for Asha 501 available.

    About traud's request, I'll get some time in the comming days to pack an example MIDlet, and make it available through this post. I'm just in a hurry right now.


    Thanks for the responses, guys!

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

    Re: Some HTTPConnection requests not working on Asha SDK 1.0

    Luiz, just give us the URL if you can. I will then update your bug.
    Last edited by traud; 2013-05-22 at 10:54.

  12. #12
    Registered User
    Join Date
    May 2013
    Location
    Manaus, Brazil
    Posts
    9

    Re: Some HTTPConnection requests not working on Asha SDK 1.0

    Sure traud.
    It's not one that the application uses, since it contains tokens/appIDs/whatnot. But this simple one also crashes on NG emulator/Devices: www.indt.org

    BR,
    Luiz

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

    Re: Some HTTPConnection requests not working on Asha SDK 1.0

    HTTP GET works on that URL here.
    Last edited by traud; 2013-05-22 at 10:55.

  14. #14
    Registered User
    Join Date
    May 2013
    Location
    Manaus, Brazil
    Posts
    9

    Re: Some HTTPConnection requests not working on Asha SDK 1.0

    Well, this same URL for me causes the problem.
    I even tested in a different network, go figure :S

    The error stack is the following:

    ..java.io.IOException: Unknown error -1 during socket::read
    - com.sun.midp.io.j2me.socket.Protocol.read0(), bci=0
    - com.sun.midp.io.j2me.socket.Protocol.nonBufferedRead(), bci=10
    - com.sun.midp.io.BufferedConnectionAdapter.readBytes(), bci=30
    - com.sun.midp.io.BaseInputStream.read(), bci=197
    - com.sun.midp.io.BufferedInputStream.read1(), bci=27
    - com.sun.midp.io.BufferedInputStream.read(), bci=39
    - java.io.DataInputStream.read(), bci=4
    - com.sun.midp.io.j2me.http.Protocol.readBytes(), bci=100
    - com.sun.midp.io.BaseInputStream.read(), bci=197
    - com.sun.midp.io.BufferedInputStream.read1(), bci=27
    - com.sun.midp.io.BufferedInputStream.read(), bci=39
    - com.sun.midp.io.FilterInputStream.read(), bci=5

    While reading the response with the current code:

    byte[] buffer = new byte[byteArraySize];

    StringBuffer sb = new StringBuffer();
    int readIn = 0;
    while ((readIn = inputStream.read(buffer)) > 0 && !aborted) {
    String temp = new String(buffer, 0, readIn);
    sb.append(temp);
    }

  15. #15
    Registered User
    Join Date
    May 2013
    Location
    Manaus, Brazil
    Posts
    9

    Re: Some HTTPConnection requests not working on Asha SDK 1.0

    I just made a simple example that demonstrates my problem.
    Unfortunately, I don't seem to have permission to attach files in the board, so I uploaded to dropbox: https://www.dropbox.com/s/2rikrgrud0...http-error.zip
    Sorry for the delay, those were crazy days around here.

    Thanks for all your support, guys
    Last edited by cavalcanti.luiz; 2013-05-22 at 02:21.

Similar Threads

  1. UDP broadcast not working (Asha 310)
    By da32x in forum Mobile Java General
    Replies: 2
    Last Post: 2013-05-03, 11:21
  2. Nokia Debug Device not working for Asha 205
    By trivedikamal123 in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2013-04-16, 15:43
  3. Multiple requests with HTTPConnection
    By tinkywinky in forum Symbian
    Replies: 3
    Last Post: 2007-07-11, 17:51
  4. Working with two asynchronous requests...
    By go4jas in forum Symbian
    Replies: 3
    Last Post: 2007-06-04, 15:44
  5. HttpConnection hangs in repeated requests
    By CM_WONG in forum Mobile Java General
    Replies: 7
    Last Post: 2003-05-30, 08:55

Posting Permissions

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