×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor
    Join Date
    Sep 2003
    Posts
    78

    HTTP Problem on series 40

    Hi,
    I'm having a problem executing a series of HTTP posts using Nokia series40 (Nokia 5310 XPress Music and Nokia Emulator series 40 5th edition).

    After a number of request ok (where I can also read correctly the response of the server) I get this error:

    java.io.IOException:
    at com.nokia.mid.impl.isa.io.protocol.internal.wap.Protocol.ensureConnec
    ted(+15)
    at com.nokia.mid.impl.isa.io.protocol.internal.wap.Protocol.openInputStr
    eam(+8)
    at com.nokia.mid.impl.isa.io.protocol.internal.wap.Protocol.openDataInpu
    tStream(+8)
    at com.sun.midp.io.j2me.http.Protocol.connect_wap(+532)
    at com.sun.midp.io.j2me.http.Protocol.connect(+63)
    at com.sun.midp.io.j2me.http.Protocol$PrivateOutputStream.flush(+21)
    at java.io.DataOutputStream.flush(+7)
    at com.nimbuzz.communication.jabber.JabberHTTP.sendHTTPRequest(+75)
    at com.nimbuzz.communication.jabber.JabberHTTP.access$200(+5)
    at com.nimbuzz.communication.jabber.JabberHTTP$RequestThread.run(+106)

    The code to send the request is:

    connection.setRequestMethod( HttpConnection.POST );
    connection.setRequestProperty( "Content-Type", CONTENTTYPE );
    connection.setRequestProperty( "Connection", "close" );

    OutputStream httpOut = connection.openOutputStream();

    // write data to stream
    httpOut.write( httpRequest.getBytes() );
    httpOut.flush();
    httpOut.close();


    The same code works fin on other phones or emulators.

    Anyone has an advice? Did someone experience the same problem?

    Emanuele Pecorari
    My Linkedin profile: http://www.linkedin.com/in/emanuelepecorari
    My Blog: http://j2mesoccer.splinder.com
    Last edited by manupeco; 2008-08-01 at 09:54.
    Emanuele Pecorari
    My Linkedin profile: http://www.linkedin.com/in/emanuelepecorari
    My Blog: http://j2mesoccer.splinder.com

  2. #2
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: HTTP Problem on series 40

    Hello manupeco,

    does this issue happen after certain number of POST requests?

    Which other devices are you referring to?

    Regards,
    r2j7
    [URL="http://library.forum.nokia.com/java"][B] >>> Java Developer's Library <<<[/B][/URL]
    [URL="https://www.developer.nokia.com/Resources/Support/Technical_support.xhtml"] [B]>>> Technical Support for Java ME development <<<[/B][/URL]
    [URL="https://publish.ovi.com/info/"][B]>>> Nokia Publish: reach millions of Nokia users worldwide through Nokia Store <<<[/B][/URL]

  3. #3
    Regular Contributor
    Join Date
    Sep 2003
    Posts
    78

    Re: HTTP Problem on series 40

    Hi,
    Yes, it happens after a certain number of post. The other devices I refer to are: Nokia N80, Sony-Ericsson W850, LG KE-970 for example.

    Do you have any idea?

    Emanuele Pecorari
    My Linkedin profile: http://www.linkedin.com/in/emanuelepecorari
    My Blog: http://j2mesoccer.splinder.com
    Emanuele Pecorari
    My Linkedin profile: http://www.linkedin.com/in/emanuelepecorari
    My Blog: http://j2mesoccer.splinder.com

  4. #4
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: HTTP Problem on series 40

    Hello manupeco,

    sorry, I meant after how many POSTs this happens?

    Are you closing HTTP connection after each POST?

    For Series 40, AFAIK if a midlet doesn't call HttpConnection.close(), then the number of connections is limited.

    Regards,
    r2j7
    [URL="http://library.forum.nokia.com/java"][B] >>> Java Developer's Library <<<[/B][/URL]
    [URL="https://www.developer.nokia.com/Resources/Support/Technical_support.xhtml"] [B]>>> Technical Support for Java ME development <<<[/B][/URL]
    [URL="https://publish.ovi.com/info/"][B]>>> Nokia Publish: reach millions of Nokia users worldwide through Nokia Store <<<[/B][/URL]

  5. #5
    Regular Contributor
    Join Date
    Sep 2003
    Posts
    78

    Re: HTTP Problem on series 40

    Hi,
    Yes, the HTTP connection is closed after each post.

    So far, no solution.

    Thanks
    Emanuele Pecorari
    My Linkedin profile: http://www.linkedin.com/in/emanuelepecorari
    My Blog: http://j2mesoccer.splinder.com
    Emanuele Pecorari
    My Linkedin profile: http://www.linkedin.com/in/emanuelepecorari
    My Blog: http://j2mesoccer.splinder.com

  6. #6
    Regular Contributor
    Join Date
    Sep 2003
    Posts
    78

    Thumbs up Re: HTTP Problem on series 40

    Hi,
    The problem has been solved. After the write there was a part of the code where an XML parsing operation was performed but the InputStream used for this operation wasn't closed after the end of the action.

    Adding the needed closing method everything works now.

    Thanks for the help
    Emanuele Pecorari
    My Linkedin profile: http://www.linkedin.com/in/emanuelepecorari
    My Blog: http://j2mesoccer.splinder.com
    Emanuele Pecorari
    My Linkedin profile: http://www.linkedin.com/in/emanuelepecorari
    My Blog: http://j2mesoccer.splinder.com

Similar Threads

  1. Series 60 Http (Vodafone only) problem
    By dmford in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2004-05-11, 21:12
  2. http post problem, series 60
    By tbabben in forum Mobile Java Networking & Messaging & Security
    Replies: 6
    Last Post: 2003-10-20, 06:30
  3. problem in http connection in 3650: is this a bug ?
    By praveenbgupta in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2003-10-13, 13:25
  4. Series 60Series 60 MIDP Concept SDK Beta 0.2 Linux bug?
    By kauppi in forum Mobile Java Tools & SDKs
    Replies: 3
    Last Post: 2003-04-07, 09:05
  5. series 40 phones(6100,6610) doesn't support http?
    By tangxj in forum Mobile Java General
    Replies: 2
    Last Post: 1970-01-01, 02:00

Posting Permissions

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