Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User Rupa's Avatar
    Join Date
    Jul 2010
    Posts
    29
    Hi,

    I am developing an application where I send some music to server . For many requests it works very well, but afterward it throws unhanded exception and asks to close the application or not?

    Following is the code :

    httpConnection = (HttpConnection) Connector.open(strUrl);
    httpConnection.setRequestMethod(HttpConnection.POST);
    if (fileData == null) {
    httpConnection.setRequestProperty("Content-Type",CONTENT_TYPE_JSON);
    if(strUrl.indexOf("/SetStatus")!=-1){
    if(COOKIE!=null){
    httpConnection.setRequestProperty("Cookie", COOKIE);
    }
    }
    }
    else {
    httpConnection.setRequestProperty("Content-Type", CONTENT_TYPE_JSON_BINARY);
    httpConnection.setRequestProperty("X-Content-Length", String.valueOf(fileData.length));
    if(COOKIE!=null){
    httpConnection.setRequestProperty("Cookie", COOKIE);
    }
    }

    httpConnection.setRequestProperty("X-Json-Length", String.valueOf(postData.length()));

    outpuStream = httpConnection.openOutputStream();
    outpuStream.write(postData.getBytes());
    if (fileData != null)
    {
    outpuStream.write(fileData);
    }

    outpuStream.flush();
    int respCode = httpConnection.getResponseCode();
    inputStream = httpConnection.openInputStream();
    String xStatus = httpConnection.getHeaderField("X-Status");


    I am not getting where I am lagging. My all code is in try catch block. Then why this unhanded exception occurred?

  2. #2
    Nokia Developer Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,671
    You should not post development related problems under the feedback section, instead you should indeed post them under the technology area you are developing with.

Similar Threads

  1. Unhandled Exception, close application error when trying hello world ...
    By nokiauser22 in forum Mobile Java Tools & SDKs
    Replies: 9
    Last Post: 2010-12-09, 15:24
  2. Unhandled Exception : close application
    By chandrap@inkrea.com in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2009-09-29, 08:53
  3. Unhandled exception.Close application?
    By kayswing in forum Mobile Java Tools & SDKs
    Replies: 8
    Last Post: 2009-02-22, 21:41
  4. how to catch "Unhandled Exception. Close application?"
    By matthiasfinke in forum Mobile Java General
    Replies: 2
    Last Post: 2006-09-19, 07:32
  5. Replies: 7
    Last Post: 2006-03-26, 18:25

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved