×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Regular Contributor
    Join Date
    May 2010
    Posts
    94

    java.lang.NullPointerException (Urgent)

    I created a application in which i am using a text file for store data.
    It is running in the Net Beans Emulator sucessfully.
    But when I install the Application in the Nokia Phone.
    Then Application install Successfully But On the start time it gives the error Like this.

    "Null Pointer
    java.lang.NullPointerException".

    What Should i do.

  2. #2
    Registered User
    Join Date
    May 2010
    Posts
    214

    Re: java.lang.NullPointerException (Urgent)

    Quote Originally Posted by nitinverma274 View Post
    I created a application in which i am using a text file for store data.
    It is running in the Net Beans Emulator sucessfully.
    But when I install the Application in the Nokia Phone.
    Then Application install Successfully But On the start time it gives the error Like this.

    "Null Pointer
    java.lang.NullPointerException".

    What Should i do.
    Look for cldc version and midp versions and look whether the phone supports the version for which u have programmed .........................................................

  3. #3
    Regular Contributor
    Join Date
    May 2010
    Posts
    94

    Re: java.lang.NullPointerException (Urgent)

    If i am not using the text file.then the application runs on the Mobile.
    But with the text file this gives the error on run time.
    But successfully run on the Netbeans Emulator.

  4. #4
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: java.lang.NullPointerException (Urgent)

    on which device are u testing this ?
    Can u get hold of a S60 device and see if you get the same error ?
    If so you might want to do some on-device debugging and see where you have a null-value variable which is getting adressed, cause thats your error...

  5. #5
    Regular Contributor
    Join Date
    May 2010
    Posts
    94

    Re: java.lang.NullPointerException (Urgent)

    I am using Nokia Xpress Music. for this.
    I have no s60 device.

  6. #6
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: java.lang.NullPointerException (Urgent)

    Quote Originally Posted by nitinverma274 View Post
    I created a application in which i am using a text file for store data.
    It is running in the Net Beans Emulator sucessfully.
    But when I install the Application in the Nokia Phone.
    Then Application install Successfully But On the start time it gives the error Like this.

    "Null Pointer
    java.lang.NullPointerException".

    What Should i do.
    The issue if from the name of the text file - in your resources - in side the JAR that you deploy.
    I feel their is CASE MISSMATCH between the actual text file name in the JAR and the name in the code.
    Thanks,
    Ekta

  7. #7
    Regular Contributor
    Join Date
    May 2010
    Posts
    94

    Re: java.lang.NullPointerException (Urgent)

    Quote Originally Posted by ektasrv View Post
    The issue if from the name of the text file - in your resources - in side the JAR that you deploy.
    I feel their is CASE MISSMATCH between the actual text file name in the JAR and the name in the code.
    Ekta, I checked All this, But Still I am facing same Problem.
    When I install the application in the Phone then that text file should not be there,
    then According to my code, My Code first create that file then write data in the file. then i am not
    understanding the Actual Problem.

  8. #8
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: java.lang.NullPointerException (Urgent)

    well place the code you think might throw the exception inside a try-catch...
    at elast you will be able to identify where it happens...

  9. #9
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: java.lang.NullPointerException (Urgent)

    Quote Originally Posted by nitinverma274 View Post
    Ekta, I checked All this, But Still I am facing same Problem.
    When I install the application in the Phone then that text file should not be there,
    then According to my code, My Code first create that file then write data in the file. then i am not
    understanding the Actual Problem.
    Check Step by Step:
    1) Install the app on a new device (w/o the text file), check if the text file is created at the right location where you want to create it in FileSystem?
    remember the path for saving a file on filesystem may be different from the path that you all allowed to save on emulator, Try to RUN PDAPDemo example app from SUN WTK on your real target device see which paths are avaiable to j2me to read/write from.
    2) If writing of the file is done, and its visible in the filesystem, check the path that you use for reading it back - it should also work.
    Thanks,
    Ekta

Similar Threads

  1. java.lang.NullPointerException
    By littleson in forum Mobile Java Networking & Messaging & Security
    Replies: 4
    Last Post: 2009-02-06, 16:13
  2. Getting java.lang.NullPointerException
    By nagesh.chetana in forum Mobile Java General
    Replies: 3
    Last Post: 2008-10-20, 10:41
  3. java.lang.nullpointerexception
    By maneeshv6 in forum Mobile Java General
    Replies: 2
    Last Post: 2008-03-25, 09:36
  4. java.lang.nullpointerexception
    By jdarelle in forum Mobile Java General
    Replies: 3
    Last Post: 2004-08-22, 08:25
  5. URGENT – Java/lang/NullPointerException
    By ManiDCI in forum Mobile Java General
    Replies: 0
    Last Post: 2004-07-13, 16:47

Posting Permissions

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