×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    Aug 2009
    Posts
    5

    java.lang.ClassNotFoundException

    Hi,

    I'm trying to biuld a Midlet application which can communicate with a web service.
    First I create the MIDlet and design it... when I test it everything works fine.
    then in the same project i choose new -> web service client, and create a new package with the client.
    The result is, in spite that the code has no errors, this error: java.lang.ClassNotFoundException: basic/HortiMart.

    HortiMart is the MIDlet class, basic is the package. The strange thing is that the MIDlet works perfectly fine untill I create the package which contains the web service client.

    Maybe this is not the way to implement this kind of application, but still for me the error is quite strange

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

    Re: java.lang.ClassNotFoundException

    Please check the path of Midlet in the main medlet in the JAD file (remeber its case senstive) and match with the JAR.
    It should be someting like basic.HortiMart not basic/HortiMart in JAD.

    thanks,
    ~Amitabh

  3. #3
    Registered User
    Join Date
    Aug 2009
    Posts
    5

    Re: java.lang.ClassNotFoundException

    This is mt JAD file:

    MIDlet-1: HortiMart, /HortiMart.png, basic.Hortimart
    MIDlet-Jar-Size: 6319
    MIDlet-Jar-URL: HortiMart.jar
    MIDlet-Name: HortiMart
    MIDlet-Vendor: Unknown
    MIDlet-Version: 1.0
    MicroEdition-Configuration: CLDC-1.1
    MicroEdition-Profile: MIDP-2.0


    and this is what is written in the manifest:

    MIDlet-1: HortiMart, /HortiMart.png, basic.Hortimart
    MIDlet-Name: HortiMart
    MIDlet-Vendor: Unknown
    MIDlet-Version: 1.0
    MicroEdition-Configuration: CLDC-1.1
    MicroEdition-Profile: MIDP-2.0


    And the error is java.lang.ClassNotFoundException: basic/Hortimart, not basic/HortiMart as I have written the first time

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

    Re: java.lang.ClassNotFoundException

    Are you following any package structure?
    MIDlet-Jar-URL: HortiMart.jar
    MIDlet-Name: HortiMart

    Midlet name should have full path like basic.HortiMart

    thanks,
    ~Amitabh

  5. #5
    Registered User
    Join Date
    Aug 2009
    Posts
    5

    Re: java.lang.ClassNotFoundException

    HortiMart is the project name while Hortimart is the MIDlet class which is in the basic package

    So are you saying that at the MIDlet-Name it should be Hortimart instead of HortiMart, moreover should it be basic.Hortimart?

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

    Re: java.lang.ClassNotFoundException

    yes it should be basic.Hortimart

    thanks,
    ~AMitabh

  7. #7
    Registered User
    Join Date
    Aug 2009
    Posts
    5

    Re: java.lang.ClassNotFoundException

    Ok, made the change. Now when i build the project it sais Error preverifying class javax.wsdl.BindingFault
    java/lang/NoClassDefFoundError: java/io/Serializable

    It is most probably related to the web client service that i'm using. I have a feeling that i have to import some kind of library to get rid of this but not sure which one and not really sure if this is what shouyld i do.

    BTW i'm using SUN JAVA Wireless ToolKit 2.5.2 and I think this has only the J2ME libraries

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

    Re: java.lang.ClassNotFoundException

    In your J2me project you can use only J2me API's... for connecting to your webservices try JSR 172, dont use your J2ee code.

    thanks,
    ~Amitabh

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

    Re: java.lang.ClassNotFoundException

    java/lang/NoClassDefFoundError: java/io/Serializable
    This is not a part of J2me java.io package.

    thanks,
    ~Amitabh

  10. #10
    Registered User
    Join Date
    Aug 2009
    Posts
    5

    Re: java.lang.ClassNotFoundException

    Thanks a lot for your time

Similar Threads

  1. Problem with SNAP libraries
    By quanxpro in forum Mobile Java Games
    Replies: 2
    Last Post: 2008-05-15, 23:47
  2. java.lang.ClassNotFoundException: calmid/MIDlet1,help please
    By imran712 in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2007-08-17, 19:51
  3. java.lang.ClassNotFoundException
    By roryfynn in forum Mobile Java General
    Replies: 2
    Last Post: 2006-02-03, 13:29
  4. java.lang.ClassNotFoundException: com/symbian/midp/io/protocol/mms/Protocol
    By chihchun in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2005-07-01, 09:24

Posting Permissions

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