×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    Registered User
    Join Date
    Dec 2010
    Posts
    35

    Thumbs up Application Error

    Hi,
    This is the error i got while executing my jar&jad File in real Nokia-6212 classic NFC enable device.
    OutofMemory Error and application come to exit
    My Device Heap size is 2MB.
    My Application Jar size is410Kb
    *It is not coming every time its come while i use to navigate in application[From one form to other].

    thanks in Advance.....

  2. #2
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: Application Error

    Quote Originally Posted by neerajj50@gmail.com View Post
    Hi,
    This is the error i got while executing my jar&jad File in real Nokia-6212 classic NFC enable device.
    OutofMemory Error and application come to exit
    My Device Heap size is 2MB.
    My Application Jar size is410Kb
    *It is not coming every time its come while i use to navigate in application[From one form to other].

    thanks in Advance.....
    neerajj50, please tell us more about the app and what the functions it is gonna doing..
    Are you using the third party API if any?
    How are you loading the resources on the device?
    What are the size of the images?
    Are you getting the same error on any other device of the same heap size.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  3. #3
    Registered User
    Join Date
    Dec 2010
    Posts
    35

    Re: Application Error

    Thanks for reply
    Actually i am using Lwuit for devlopment where i implemented a theme of size 2 kb some time app work fine but some time it shows application error outofmemory i am not able to rectify it .pls help

  4. #4
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: Application Error

    Quote Originally Posted by neerajj50@gmail.com View Post
    Thanks for reply
    Actually i am using Lwuit for devlopment where i implemented a theme of size 2 kb some time app work fine but some time it shows application error outofmemory i am not able to rectify it .pls help
    You start working with the Memory Monitor, and you can have the details about the usage of the objects and their memory occupation. As per the results you can work with the same.
    2 KB theme should not be any issue for the Nokia 6212. You also provide the other details that I asked in my previous post.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  5. #5
    Registered User
    Join Date
    Dec 2010
    Posts
    35

    Re: Application Error

    Raj,
    Size of images are115kb
    No 3rd party Api.................
    only sdk 6112 Apis
    loading means i am instaling only jad & jar in device .

  6. #6
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: Application Error

    Quote Originally Posted by neerajj50@gmail.com View Post
    Raj,
    Size of images are115kb
    No 3rd party Api.................
    only sdk 6112 Apis
    loading means i am instaling only jad & jar in device .
    How are you rendering the images ?
    inside the loop or how?

    Why dont you more optimize the images using the pngout.exe to get the size much more smaller.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  7. #7
    Registered User
    Join Date
    Dec 2010
    Posts
    35

    Re: Application Error

    Ok let me Explain:
    In My App i am adding more than two commands on Lwuit Form
    It Is Coming but the time i click on menu it is giving me Application error
    Now i think it is not due to Heap size .may be some coding prob or what
    Not able to rectify.
    i am simply rendring the image on button .

  8. #8
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: Application Error

    Quote Originally Posted by neerajj50@gmail.com View Post
    Ok let me Explain:
    In My App i am adding more than two commands on Lwuit Form
    It Is Coming but the time i click on menu it is giving me Application error
    Yes your point is correct, that is not due to the heap or so.
    Please check the commands that you added, I am sure that either of the commands is null, recommend that you check and create the commands inside the try-catch block.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  9. #9
    Registered User
    Join Date
    Dec 2010
    Posts
    35

    Re: Application Error

    I did each & every thingh but not able to rid of the prob .............

  10. #10
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: Application Error

    Quote Originally Posted by neerajj50@gmail.com View Post
    I did each & every thingh but not able to rid of the prob .............
    When you press the details button/command on the applcation eror screen what the text device is dispaying?
    Share the code related to the command,
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  11. #11
    Registered User
    Join Date
    Dec 2010
    Posts
    35

    Re: Application Error

    public class MenuItems extends Form {

    Button btn_admin, btn_transaction, btn_mines, btn_sodddo, btn_vagus_complex;
    Form form;
    private Image image;
    Command info;
    Command exit;
    Container c;
    Command count;
    Label lbl_hhrid, lbl_space;

    ;
    Container container;
    boolean exit_flag = true;

    public MenuItems(String title) {

    super(title);
    initialisaton();
    addComponent();
    }

    public Label newLabel() {
    Label spaceLabel = new Label(" ");
    spaceLabel.setAlignment(Component.CENTER);
    spaceLabel.getUnselectedStyle().setBgTransparency(0);
    return spaceLabel;
    }

    public void initialisaton() {
    setLayout(new BoxLayout(BoxLayout.Y_AXIS));
    this.setMenuCellRenderer(new DefaultListCellRenderer(false));
    container = new Container(new GridLayout(2, 2));
    //setLayout(new GridLayout(1, 1));
    lbl_space = new Label(" ");
    lbl_hhrid = new Label(" HHR ID :" + ApplicationMidlet.hhr_id);
    lbl_hhrid.getUnselectedStyle().setFgColor(13047173);
    try {
    btn_admin = new Button(Image.createImage("/admin.png"));
    btn_mines = new Button(Image.createImage("/operations.png"));
    btn_vagus_complex = new Button(Image.createImage("/operations.png"));
    } catch (IOException ex) {
    ex.printStackTrace();
    }
    //btn_admin.setTextPosition(Component.RIGHT);

    //btn_mines.setTextPosition(Component.RIGHT);
    btn_vagus_complex.addActionListener(new ActionListener() {

    public void actionPerformed(ActionEvent arg0) {
    ApplicationMidlet.vagusComplexForm.show();
    }
    });
    btn_mines.addActionListener(new ActionListener() {

    public void actionPerformed(ActionEvent arg0) {

    if (ApplicationMidlet.midlet.access_to_sigao) {
    ApplicationMidlet.loadParameterOREForm.getLongRouteCodes();
    ApplicationMidlet.loadParameterOREForm.getProductCodes();
    ApplicationMidlet.loadParameterOREForm.getSourceLocation();
    ApplicationMidlet.loadParameterOREForm.getSourceSubLocation();
    ApplicationMidlet.loadParameterOREForm.getDestinationLocation();
    ApplicationMidlet.loadParameterOREForm.getBillingCategory();
    ApplicationMidlet.loadParameterOREForm.getMachineCodes();

    ApplicationMidlet.loadParameterREJForm.getShortRouteCodes();
    ApplicationMidlet.loadParameterREJForm.getProductCodes();
    ApplicationMidlet.loadParameterREJForm.getSourceLocation();
    ApplicationMidlet.loadParameterREJForm.getSourceSubLocation();
    ApplicationMidlet.loadParameterREJForm.getDestinationLocation();
    ApplicationMidlet.loadParameterREJForm.getBillingCategory();
    ApplicationMidlet.loadParameterREJForm.getMachineCodes();

    ApplicationMidlet.uf.getDestinationLocation();
    ApplicationMidlet.uf.getDestinationSublocation();

    }

    //ApplicationMidlet.forcefullyClosedForm.getDestinationLocation();
    // ApplicationMidlet.forcefullyClosedForm.getDestinationSublocation();

    ApplicationMidlet.TransactionsForm.show();
    }
    });

    btn_sodddo = new Button("Soddo", image);
    btn_sodddo.setTextPosition(Component.RIGHT);
    // btn_vagus_complex= new Button("Vagus Complex",image);
    // btn_vagus_complex.setTextPosition(Component.RIGHT);
    btn_admin.addActionListener(new ActionListener() {

    public void actionPerformed(ActionEvent arg0) {

    ApplicationMidlet.admin.show();
    //String s=ApplicationMidlet.midlet.getCheckSum("abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789cfgvbh1254kl");
    // for(int i=0;i<256;i++)
    // {
    // int s=i;
    // Dialog.show("INFO","char is : "+(char)s+"\n"+"ASCII : "+s,"Ok","Cancel");
    // Dialog.show("INFO", ApplicationMidlet.midlet.displayHexString(""+(char)s),"Ok", "Cancel");
    // }
    }
    });
    try{
    exit = new Command("Exit") {

    public void actionPerformed(ActionEvent ev) {
    RecordStore rs = null;
    try {
    rs = RecordStore.openRecordStore("VMSBOfflineRecordMemory", false);
    int records = rs.getNumRecords();
    rs.closeRecordStore();
    exit_flag = Dialog.show("INFO", "Number of transactions : " + records, "Ok", "Cancel");
    exitApp(exit_flag);
    } catch (RecordStoreException ex) {
    exit_flag = Dialog.show("INFO", "No records present !", "Ok", "Cancel");
    exitApp(exit_flag);
    } finally {
    try {
    rs.closeRecordStore();
    } catch (RecordStoreNotOpenException ex) {
    ex.printStackTrace();
    } catch (RecordStoreException ex) {
    ex.printStackTrace();
    }
    }

    }
    };
    }catch(OutOfMemoryError oe)
    {
    System.out.println("Exception1 :"+oe.toString());
    }
    try{
    info = new Command("Info") {

    public void actionPerformed(ActionEvent ev) {
    Dialog.show("INFO", "VMSB", "OK", "Cancel");
    //ApplicationMidlet.midlet.errorTone();
    }
    };
    }catch(OutOfMemoryError oe)
    {
    System.out.println("Exception 2:"+oe.toString());
    }


    try {

    count = new Command("Get Count") {

    public void actionPerformed(ActionEvent ae) {
    System.out.println("Inside Count menu0 ");
    displayCount();
    }
    };
    } catch (OutOfMemoryError oe) {
    System.out.println("Exception 3:" + oe.toString());
    }


    }

    public void addComponent() {
    addComponent(lbl_hhrid);
    addComponent(lbl_space);
    container.addComponent(btn_admin);
    container.addComponent(btn_mines);
    container.addComponent(btn_vagus_complex);
    addComponent(container);
    // addComponent(btn_admin);
    // addComponent(btn_mines);
    try{
    addCommand(exit);
    addCommand(count);
    addCommand(info);
    }catch(OutOfMemoryError oe)
    {
    System.out.println("Exception :"+oe.toString());
    }

    }

    private void exitApp(boolean end_flag) {
    if (end_flag) {
    ApplicationMidlet.midlet.destroyApp(true);
    ApplicationMidlet.midlet.notifyDestroyed();
    }

    }

    private void displayCount() {
    System.out.println("Inside Count menu ");
    String info1 = "";
    try {
    ApplicationMidlet.midlet.routineDate();
    String rs_name = ApplicationMidlet.midlet.myDate.substring(0, 8);
    RecordStore rs_ = RecordStore.openRecordStore(rs_name, false);
    RecordEnumeration re = rs_.enumerateRecords(null, null, false);
    if (re.numRecords() > 0) {
    while (re.hasNextElement()) {
    byte[] bt = re.nextRecord();
    String name = new String(bt);

    try {
    RecordStore rs1 = RecordStore.openRecordStore(name, false);
    RecordEnumeration re1 = rs1.enumerateRecords(null, null, false);
    while (re1.hasNextElement()) {
    byte[] bt1 = re1.nextRecord();
    String count1 = new String(bt1);
    int c1 = Integer.parseInt(count1.substring(0, 4));
    int c2 = Integer.parseInt(count1.substring(4, 8));
    int c3 = Integer.parseInt(count1.substring(8, 12));
    info1 = info1 + "\n" + name + "\n" + "ROM :" + c1 + "\n" + "REJ :" + c2 + "\n" + "P.ORE :" + c3;
    }
    rs1.closeRecordStore();
    } catch (Exception ex1) {
    }
    }
    rs_.closeRecordStore();
    if (info1.trim().length() > 0) {
    Dialog.show("INFO", info1, "Ok", "Cancel");
    } else {
    Dialog.show("INFO", "0 records !", "Ok", "Cancel");
    }

    }

  12. #12
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: Application Error

    You are not following the best practices for the Programming...
    There are many issues with your code:

    1. Please note that you are creating every command before you handle that one and then you are implementing the actionPerformed() method respectively.
    2. You are not checking that which command are you trying to process inside the actionPerformed()
    3. For the other entities also you have follow the same practice.

    Solution.

    1. Create all the initialization in one go and even if you do it locally then put the command type check inside the command handler, actionPerformed(),
    2. Make the one handler and put the switch or if-else condition for the every condition.

    As there is no command check inside the one handler and as you are creating the command on the go and hence you actionPerformed() is throwing the null pointer exception.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  13. #13
    Registered User
    Join Date
    Dec 2010
    Posts
    35

    Re: Application Error

    Ok i am Sorry for not following best practices.
    But I find one thingh that When i remove the
    theam the app is working fine.So i am thinking abt
    Stack over flow.What did u say.?....

  14. #14
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: Application Error

    Quote Originally Posted by neerajj50@gmail.com View Post
    Ok i am Sorry for not following best practices.
    But I find one thingh that When i remove the
    theam the app is working fine.So i am thinking abt
    Stack over flow.What did u say.?....
    I suspect that 2KB of theme can lead you OOM exception. But if this is happening then you need to take extra about the same, like how you are loading the theme and using this.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  15. #15
    Registered User
    Join Date
    Dec 2010
    Posts
    35

    Re: Application Error

    I thnk abt that i just created theme of200byte & added again same prom ,i can not let out the theme its imp.
    Pls re think abt it.
    Its plesure to get chance to comm with u people thanks Raj...................

Similar Threads

  1. Replies: 7
    Last Post: 2009-02-12, 13:37
  2. Carbide 2.00, Application TRK 3.09, Error: 0x20 Unspecified general OS-related error
    By hyuan in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 2
    Last Post: 2009-02-03, 20:26
  3. Nokia 6131i develop application Error: Out Of Memory Error
    By flycatrat in forum Near Field Communication
    Replies: 0
    Last Post: 2007-08-28, 11:10
  4. Application Error : No Class Def Found Error
    By josephsim in forum Mobile Java General
    Replies: 2
    Last Post: 2007-01-25, 20:49
  5. Replies: 2
    Last Post: 2004-08-02, 18:11

Posting Permissions

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