×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Jul 2004
    Posts
    22

    java.lang.NoClassDefFoundError with JSR75

    Good day.

    I made a midp 2.0 cldc 1.0 application that use JSR75 (for PIM and File Connection).
    On my Samsung ZV10 when I try to run the midlets I obtain the above errors:
    java.lang.NoCallsDefFoundError javax/microedition/pim/PIMEception
    or
    java.lang.NoClassDefFoundError javax/microedition/io/file/FileConnection

    I suppose that the phone is incompatible with JSR75.

    I try it on Nokia 6600 and the same midlets don't run (I suppose for identical reason; any message appears).
    On Nokia E65 all run correctly.

    I should want to having one version for all phones and then I ask you if is it possible to set something on midp application in order to disable the use of JSR75 for the phones non compatible with it (a type of try catch to application level).

    Best regards and good work.

    Stefano Errani

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: java.lang.NoClassDefFoundError with JSR75


  3. #3
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,073

    Re: java.lang.NoClassDefFoundError with JSR75

    Because of its optional nature JSR 75, this package of APIs may not always be available on every platform. Each profile and platform may have their own methods for J2ME package discovery as there is no universal method existing at this time.

    An additional method for package discovery of the PIM APIs is by using a system properties query. To discover this package, call System.getProperty with a key of microedition.pim.version. If the API is present, the value returned is the version of the API (e.g. "1.0"). If the API is not present then the key is also not present and null is returned.

    Other option will be create the instance of the required class in try,catch and capture the "ClassNotFoundExcepion" exception.

    thanks,
    ~Amitabh

  4. #4
    Registered User
    Join Date
    Jul 2004
    Posts
    22

    Re: java.lang.NoClassDefFoundError with JSR75

    Good day.

    Regarding "How to use an optional API in Java ME." link, I have a question:
    In it is wrote to use LocationProvider provider = LocationProvider.getProvider(); but if I must to use it in a non static method "the non-static method ... cannot be referenced from a static context" error appears.
    How can I resolve it?

    Best regards and good work.

    Stefano Errani

  5. #5
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,073

    Re: java.lang.NoClassDefFoundError with JSR75

    Thats just an example for finding the availbility of Optional JSR 179 on the device....by capturing ClassNotFoundExcepion.
    Please comment that line and try.

    Serach wiki for using JSR 179 if you want to try it out...

    thanks,
    ~Amitabh

  6. #6
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: java.lang.NoClassDefFoundError with JSR75

    Quote Originally Posted by erracid8 View Post
    Good day.

    Regarding "How to use an optional API in Java ME." link, I have a question:
    In it is wrote to use LocationProvider provider = LocationProvider.getProvider(); but if I must to use it in a non static method "the non-static method ... cannot be referenced from a static context" error appears.
    How can I resolve it?

    Best regards and good work.

    Stefano Errani
    Sorry, the LocationProvider.getProvider() method should be static. I've corrected the Wiki page.

    You'll need to adapt this technique to use the API you want. As the article describes, you need to be careful not to load any classes that refer to the missing API.

    Graham.

  7. #7
    Registered User
    Join Date
    Jul 2004
    Posts
    22

    Re: java.lang.NoClassDefFoundError with JSR75

    Infact as static all run correctly.

    Best regards and good work.

    Stefano Errani

Similar Threads

  1. Can't access series 40 General number via JSR75
    By mottsc in forum Mobile Java General
    Replies: 16
    Last Post: 2009-02-27, 11:28
  2. List of Nokia phones with JSR75
    By charlie_alpha in forum Mobile Java General
    Replies: 14
    Last Post: 2009-01-09, 11:05
  3. Virtual Machinery add JSR75 Support to BTree Product
    By kenhall2 in forum News and Announcements
    Replies: 0
    Last Post: 2007-12-03, 13:37
  4. S40 JSR75 Plz Help
    By elvic_jinesh in forum Mobile Java General
    Replies: 2
    Last Post: 2006-03-12, 04:56
  5. JSR75 file access -- URGENT
    By earamsey in forum Mobile Java General
    Replies: 5
    Last Post: 2005-10-20, 08: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
  •