×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    23

    6131 vs 6212 no class def found error

    Hi

    I have a "No Class Def Found Error java/lang/NoClassDefFoundError"
    "java/lang/UnsupportedOperationException"

    on my 6131. On the 6212 the code worx

    since latest working version I added these imports:
    Code:
    import java.io.IOException;
    import java.io.OutputStream;
    import java.io.PrintStream;
    import java.util.Calendar;
    import java.util.Date;
    import javax.microedition.io.file.FileConnection;
    import javax.microedition.io.Connector;
    import javax.microedition.io.OutputConnection;
    import java.util.*;
    import javax.microedition.rms.*;
    in different files.

    On both emulators it works

    What could be the reason i get that error??
    Last edited by studioj; 2009-03-26 at 14:43.

  2. #2
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: 6131 vs 6212 no class def found error

    Could you narrow down a little, which line in your code causes that exception. Note that there are differences in the available APIs on those phones, 6131 NFC does not have all the same APIs available than what is on 6212...
    http://www.forum.nokia.com/devices/6212_classic
    http://www.forum.nokia.com/devices/6131_NFC

    Hartti

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

    Thumbs up Re: 6131 vs 6212 no class def found error

    Hi,
    Now you can compare the both listing and then you will come to know that what are the JSR's supported and what are not for the both devices..
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  4. #4
    Registered User
    Join Date
    Mar 2008
    Posts
    23

    Re: 6131 vs 6212 no class def found error

    I'm not using any of the api's which are not compatible with the 6131.

    How can I see at which line the error is thrown??

    Its just in the main constructor i guess. The application itself wont start

    Code:
    public class Guimobileterminal extends MIDlet implements CommandListener, TargetListener {
        private Form login, accesControl,accesControlScan,balance,voucher,voucherScan;
        private List mainMenuList,accesControlList,voucherList,accesControlChoice;
        private TextField voucherToDeduct;
        private Command any = new Command ("Any",Command.OK,0);
        private Command enterCommand = new Command ("ENTER",Command.OK,0);
        private Command clearCommand = new Command ("CLEAR",Command.BACK,0);
        private DiscoveryManager dm = DiscoveryManager.getInstance();
        private String[] mainMenuElements = {"1.Acces Control","2.Voucher"};
        private String[] accesControlElements = {"1.Entrance","2.Exit","3.Entrance/Exit"};
        private String[] voucherListElements, accessListElements;
        private int status = 0;
        private int amountDeduct;
        private int voucherIndex;
        private long long_accessVoucher;
        private long long_voucher;
        private byte[] accessVoucher;
        private byte[] k = {(byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF};
        private MFKey.KeyA key = new MFKey.KeyA(k);
        private MFStandardConnection conn;
        private final static byte[] hexChars = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
        IConfig config = new ConfigOCD();
        TransactionToFile trans = new TransactionToFile();
        
    
    
    public Guimobileterminal(){
        
        login = new Form ("Login Screen");
        login.append("<Touch Tag to login>");
        mainMenuList = new List ("Main menu",List.IMPLICIT,mainMenuElements,null);
        String b = trans.possible();
        System.out.println(b);
    //    try
    //    {
    //        FileBasedPreferences fbp = new FileBasedPreferences("pref");
    //    }
    //    catch(IOException io)
    //    {
    //        trans.error(io);
    //    }
        if(b==null)
        {
            Alert a = new Alert("Transations cannot be logged, shutting down");
            Display.getDisplay(this).setCurrent(a,login);
            notifyDestroyed();
        }
    
        
        // build lists
        make_listElements();
        try
        {
            dm.addTargetListener(this, TargetType.RFID_TAG);
        }
        catch (ContactlessException ce )
        {
            trans.error(ce);
            Alert a = new Alert ("Unable to register TargetListener: " + ce);
            Display.getDisplay(this).setCurrent(a,login);
            notifyDestroyed();
        }

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

    Re: 6131 vs 6212 no class def found error

    This Error is probably not thrown by executing code. It is usually thrown by the class loader (within the VM), when it tries to link a loaded class. The loader tries to find all other classes referenced by the new class, and to load them. (It will subsequently try to load all the classes referenced by those classes too.) So, the Error is not necessarily thrown "at a line". It could be thrown before any of your code is executed.

    In this case, some class is refering to java.lang.UnsupportedOperationException. The 6212 contains this class; it's part of the Security and Trust Services API (JSR 177). The 6131 does not support this API, so does not provide this class.

    Somewhere in your JAR, a class refers to this java.lang.UnsupportedOperationException.

    Cheers,
    Graham.

  6. #6
    Registered User
    Join Date
    Mar 2008
    Posts
    23

    Re: 6131 vs 6212 no class def found error

    thanx graham, will scann my exception handling for possible incompatibilities.

    I found it, stupid i didnt see that.

    when you implement an Interface Netbeans automaticly fills in all functions with this as code
    Code:
    throw new UnsupportedOperationException ("Not supported yet.")
    Last edited by studioj; 2009-03-31 at 11:43.

Similar Threads

  1. No Class Def Found Error
    By itg2 in forum Mobile Java General
    Replies: 6
    Last Post: 2009-07-13, 18:57
  2. [newbie here] Link error
    By xitpu in forum Symbian
    Replies: 3
    Last Post: 2007-01-24, 16:53
  3. Carbide.vs 2.01 Registration Problem
    By baykal in forum Symbian Tools & SDKs
    Replies: 5
    Last Post: 2006-12-22, 16:55
  4. error LNK2001: Please Help
    By sourish_khan in forum Symbian
    Replies: 9
    Last Post: 2006-04-19, 11:16
  5. can not successfully link any sample using .NET
    By lobotomat in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2002-08-20, 00:29

Posting Permissions

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