×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    18

    6230i & 6021 reboots on http open.

    Hi,
    We have been struggling a while with that our application reboots on our series 40 devices.
    This crash is really hard to reproduce since it don't happen most of the time.
    We finally traced it down to when the http connection being opened.

    Is this a known error?
    Has anyone experienced the same?
    Is there a workaround?

    I did read through the Known issues and have searched the forums but found nothing.

    Our set-up is as follows:
    Permission for http is set in the jar signed jar file.
    The MIDlet is set to prompt for access to the network every time.

    Most of the time (like 19 of 20 tries) when the connection is executed, the prompt is shown and whether choosing to allow or not allow the connection the application executes fine.

    But,
    Some times the application causes the phones to reboot, before the prompt is shown.

    This bug was hard to trace down since no Throwables are thrown.
    One could expect some RuntimeException, but no.

    The firmwares of the two devices are:
    Nokia 6021: V 03.93
    Nokia 6230i: V 03.46

    Code for http used when this crash appeared:

    Code:
    public StreamConnection openStreamConnection(String url, String contentType, int contentLength) throws IOException
        {
            try
            {
                trace("Start openStreamConnection");
                Thread.sleep(500);
    
                String params = model.getRouterProperty(RouterProperties.KEY_URL_POSTFIX_PARAMS, "");
                
                trace("got RouterProperty: " + model.getRouterProperty(RouterProperties.KEY_URL_POSTFIX_PARAMS, ""));
                Thread.sleep(500);
    
                HttpConnection con = (HttpConnection)Connector.open(url + params, 3); //Connector.READ_WRITE );
                trace("opened httpConnection");
                Thread.sleep(500);
    
                con.setRequestProperty("Excpect", "");
                trace("set requestProperty excpect");
                Thread.sleep(500);
    
                con.setRequestProperty( "Content-Type", contentType );
                trace(" set Content-Type: " + contentType + " (Request)");
                Thread.sleep(500);
    
                con.setRequestProperty( "Content-Length", String.valueOf(contentLength));
                Thread.sleep(500);
    
                trace("set request property Content-Length" + String.valueOf(contentLength));
               
                con.setRequestMethod( HttpConnection.POST );
                trace("set request method POST");
                Thread.sleep(500);
    
                trace("returning openStreamConnection");
                
                return con;
            }
            catch(InterruptedException ie)
            {
                trace("debug InterruptedException");
                return null;
            }
        }
        
        public void ourHttpStarter(int length) throws IOException
        {
            try
            {
                header = this.getHeader(length);
                trace("url: " + url);
                trace("contentType: " + this.getContentTypeRequest());
                trace("h.length + header" + (header.length + length));
    
                try
                {
                    if(null != con) con.close();
                }
                catch(IOException ioe){}
    
                con = openStreamConnection(url, this.getContentTypeRequest(), header.length + length);
    
            }
            catch(IOException ioe)
            {
                throw ioe;
            }
            catch(SecurityException se)
            {
                trace("SecurityException: " + se.getMessage());
                throw new IOException(se.getMessage());
            }
            catch(IllegalArgumentException iae)
            {
                trace("IllegalArgumentException: " + iae.getMessage());
                throw new IOException(iae.getMessage());
            }
            catch(Throwable t)
            {
                trace("Throwable:" + t.getMessage());
                throw new IOException(t.getMessage());
            }
        }
    Debug trace output:

    url: H_t_t_p://aRealUrl
    contentType: application/XXXX
    h.length + header 43
    Start openStreamConnection
    got RouterProperty:

    Thanks
    Martin

  2. #2
    Registered User
    Join Date
    Nov 2004
    Posts
    23

    Re: 6230i & 6021 reboots on http open.

    I have a similar problem, with serie40.
    My device for test is 6020, with Edge and other nice features, but it can´t send any data over http, and for me it´s a hughe problem .... please, if some one knows a trick, post here.

  3. #3
    Registered User
    Join Date
    Oct 2005
    Posts
    18

    Re: 6230i & 6021 reboots on http open.

    Anyone, please. Any help appreciated.
    This is a real show stopper since the risk of loosing data being processed.
    If we cannot resolve this we can no longer claim support for series 40 devices.

    Is there anywhere one can report bugs at forum Nokia?

    br Martin

  4. #4
    Nokia Developer Expert
    Join Date
    Jun 2005
    Posts
    923

    Re: 6230i & 6021 reboots on http open.

    This sounds like a firmware problem, but let's speculate a little more: why are you setting the connection as an instance variable instead of performing a quick open/write/read/close operation? Are you opening any input/output streams, and if so, are they being closed correctly? Have you tried System.gc() after closing the connection?

    Daniel

  5. #5
    Registered User
    Join Date
    Oct 2005
    Posts
    18

    Re: 6230i & 6021 reboots on http open.

    Hi Daniel,

    We need the instance since we are setting request headers, posting request bodies and reading the response bodies.

    In our real implementation we are opening input/output streams but while debugging we have stripped it down to just calling the Connector.open method.

    How we close the connection is not really interesting since the MIDlet crashes while checking for permissions (before prompting). (we are restarting the MIDlet between the tests)

    On MIDlet start-up we start a Bluetooth server (StreamConnectionNotifier acceptAndOpen). We have observed that when disabling this, the MIDlet won't crash.

    Can it be that the Series 40 devices have problems handling multiple Connector objects or multiple external resources (including RMS)?

    Many thanks,
    Martin

Similar Threads

  1. http connection error in 6230i
    By corej2me in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2006-05-19, 16:04
  2. 6230i reboots installing MIDlet
    By deanandreakis in forum Mobile Java General
    Replies: 1
    Last Post: 2005-11-27, 02:08
  3. Getting IO Exception try to open HTTP connection.
    By Woody_FX in forum Mobile Java General
    Replies: 1
    Last Post: 2005-10-07, 16:31
  4. http connection via a proxy programmatically
    By tiansun in forum Mobile Java General
    Replies: 0
    Last Post: 2005-04-19, 02:47
  5. Open a HTTP Get request and displaying HTML-Source Code
    By edmund66 in forum Mobile Java General
    Replies: 0
    Last Post: 2004-10-01, 13:41

Posting Permissions

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