Error in convertionof .class to CAP file

we are using java_card_kit-2_2_1 with j2sdk-1.4.2_12 for developing Applet for Smart card.We are new to the javacard enviornment.We are testng with the avvailable samples in java card kit.
The steps we are following is given below:
1.Convertion of java file to class file.
Class file generated in the path- c:\java_card_kit-2_2_1\samples\src\com\sun\javacard\samples\Helloworld
2. convertion of class file to Cap file:
we are using one batch file -run.bat
run.bat:
set CLASSES=%JCHOME%\lib\apduio.jar;...;%JC_HOME%\lib\api.jar;%JC_HOME%\lib\capdump.jar;
xcopy /s %JC_HOME%\api_export_files\*.* exp
java -classpath %_CLASSES% samples.src.com.sun.javacard.samples
converter -config HelloWorld.opt
3.We are running the run.bat file when exp folder is created having the .exp files init.
4.Then we are using the converter as:
converter -config ...HelloWorld.opt.
the .opt file contains..
-out EXP JCA CAP
-exportpath C:\java_card_kit-2_2_1\api_export_files
-applet 0xa0:0x0:0x0:0x0:0x62:0x3:0x1:0xc:0x1:0x1
com.sun.javacard.samples.HelloWorld.HelloWorld
com.sun.javacard.samples.HelloWorld
0xa0:0x0:0x0:0x0:0x62:0x3:0x1:0xc:0x1 1.0
Then the error is generated as:
error:export file framework.exp of package javacard.framework not found.
the above run.bat file the line below needs explanation..
java -classpath %_CLASSES% samples.src.com.sun.javacard.samples
converter -config HelloWorld.opt
plz reply
Message was edited by:
jit_hk

converting .class files to a loadable format for the smart card creates .cap file and .exp files. the .exp files specify information about any (shared) libraries.
i dunno how exactly to do it with the java card kit from sun. look into the jcop converter tric.jar .

Similar Messages

  • Why require cap file why not only class file as in java

    why do we convert .class to .cap file why not simply load the .clss file to the card

    If Java Card has to accept .class file, it's certain
    that JCVM developers are going to spend more and more
    nights in their office.
    Just kidding. I'm one of them.LOL :)
    Put the CAP file converter on-card.

  • ERROR while generating CAP file

    Hello,
    Iam trying to generate a cap file of JCRMI applet. Iam getting the following errors while generating a CAP file. Can anybody help me.
    Thanks in advance,
    With Regards,
    Abhishek Goud
    {color:#ff0000}{color:#008080}*C:\Documents and Settings\Administrator\Desktop\Demo>converter -classdir C:\jav*
    a_card_kit-2_2_2\lib -exportpath C:\java_card_kit-2_2_2\api_export_files;C:\java
    cardkit-2_2_2\lib -applet 0xa0:0x00:0x00:0x00:0x62:0x03:0x01:0x08:0x01 PurseAp*
    plet com.sun.javacard.samples.RMIDemo 0xa0:0x00:0x00:0x00:0x62:0x12:0x34 1.3
    {color}
    Java Card 2.2.2 Class File Converter, Version 1.3
    Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to lic
    ense terms.
    warning: You did not supply export file for the previous minor version of the pa
    ckage
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported type long of
    field serialVersionUID.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unhandled bytecode ifnull in clinit method, try a different compiler.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unhandled bytecode goto
    in clinit method, try a different compiler.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported bytecode inv
    okestatic in clinit method.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported parameter ty
    pe String of invoked method class$(java.lang.String) of class com.sun.javacard.s
    amples.RMIDemo.PurseImpl_Stub.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported bytecode ane
    warray in clinit method.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported bytecode aas
    tore in clinit method.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported bytecode inv
    okevirtual in clinit method.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported parameter ty
    pe String of invoked method getMethod(java.lang.String, java.lang.Class) of clas
    s java.lang.Class.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unhandled bytecode ifnul
    l in clinit method, try a different compiler.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unhandled bytecode goto
    in clinit method, try a different compiler.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported bytecode inv
    okestatic in clinit method.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported parameter ty
    pe String of invoked method class$(java.lang.String) of class com.sun.javacard.s
    amples.RMIDemo.PurseImpl_Stub.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported bytecode ane
    warray in clinit method.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported bytecode aas
    tore in clinit method.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported bytecode inv
    okevirtual in clinit method.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported parameter ty
    pe String of invoked method getMethod(java.lang.String, java.lang.Class) of clas
    s java.lang.Class.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unhandled bytecode ifnul
    l in clinit method, try a different compiler.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unhandled bytecode goto
    in clinit method, try a different compiler.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported bytecode inv
    okestatic in clinit method.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported parameter ty
    pe String of invoked method class$(java.lang.String) of class com.sun.javacard.s
    amples.RMIDemo.PurseImpl_Stub.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported bytecode ane
    warray in clinit method.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported bytecode inv
    okevirtual in clinit method.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported parameter ty
    pe String of invoked method getMethod(java.lang.String, java.lang.Class) of clas
    s java.lang.Class.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unhandled bytecode ifnul
    l in clinit method, try a different compiler.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unhandled bytecode goto
    in clinit method, try a different compiler.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported bytecode inv
    okestatic in clinit method.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported parameter ty
    pe String of invoked method class$(java.lang.String) of class com.sun.javacard.s
    amples.RMIDemo.PurseImpl_Stub.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported bytecode ane
    warray in clinit method.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported bytecode inv
    okevirtual in clinit method.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported parameter ty
    pe String of invoked method getMethod(java.lang.String, java.lang.Class) of clas
    s java.lang.Class.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unhandled bytecode ifnul
    l in clinit method, try a different compiler.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unhandled bytecode goto
    in clinit method, try a different compiler.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported bytecode inv
    okestatic in clinit method.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported parameter ty
    pe String of invoked method class$(java.lang.String) of class com.sun.javacard.s
    amples.RMIDemo.PurseImpl_Stub.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported bytecode ane
    warray in clinit method.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unhandled bytecode ifnul
    l in clinit method, try a different compiler.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unhandled bytecode goto
    in clinit method, try a different compiler.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported bytecode inv
    okestatic in clinit method.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported parameter ty
    pe String of invoked method class$(java.lang.String) of class com.sun.javacard.s
    amples.RMIDemo.PurseImpl_Stub.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported bytecode aas
    tore in clinit method.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported bytecode inv
    okevirtual in clinit method.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported parameter ty
    pe String of invoked method getMethod(java.lang.String, java.lang.Class) of clas
    s java.lang.Class.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unhandled bytecode goto
    in clinit method, try a different compiler.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unhandled bytecode pop i
    n clinit method, try a different compiler.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported bytecode new
    in clinit method.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported bytecode inv
    okespecial in clinit method.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported parameter ty
    pe String of invoked method <init>(java.lang.String) of class java.lang.NoSuchMe
    thodError.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported bytecode ath
    row in clinit method.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported parameter ty
    pe String of method class$.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported parameter ty
    pe String of invoked method forName(java.lang.String) of class java.lang.Class.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported return type
    String of invoked method getMessage() of class java.lang.Throwable.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported parameter ty
    pe String of invoked method <init>(java.lang.String) of class java.lang.NoClassD
    efFoundError.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported long type co
    nstant.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported parameter ty
    pe long of invoked method invoke(java.rmi.Remote, java.lang.reflect.Method, java
    *.lang.Object, long) of class java.rmi.server.RemoteRef.*
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported String type
    constant.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported parameter ty
    pe String of invoked method <init>(java.lang.String, java.lang.Exception) of cla
    ss java.rmi.UnexpectedException.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported long type co
    nstant.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported parameter ty
    pe long of invoked method invoke(java.rmi.Remote, java.lang.reflect.Method, java
    *.lang.Object, long) of class java.rmi.server.RemoteRef.*
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported String type
    constant.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported parameter ty
    pe String of invoked method <init>(java.lang.String, java.lang.Exception) of cla
    ss java.rmi.UnexpectedException.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported long type co
    nstant.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported parameter ty
    pe long of invoked method invoke(java.rmi.Remote, java.lang.reflect.Method, java
    *.lang.Object, long) of class java.rmi.server.RemoteRef.*
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported String type
    constant.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported parameter ty
    pe String of invoked method <init>(java.lang.String, java.lang.Exception) of cla
    ss java.rmi.UnexpectedException.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported long type co
    nstant.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported parameter ty
    pe long of invoked method invoke(java.rmi.Remote, java.lang.reflect.Method, java
    *.lang.Object, long) of class java.rmi.server.RemoteRef.*
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported String type
    constant.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported parameter ty
    pe String of invoked method <init>(java.lang.String, java.lang.Exception) of cla
    ss java.rmi.UnexpectedException.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported long type co
    nstant.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported parameter ty
    pe long of invoked method invoke(java.rmi.Remote, java.lang.reflect.Method, java
    *.lang.Object, long) of class java.rmi.server.RemoteRef.*
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported String type
    constant.
    error: com.sun.javacard.samples.RMIDemo.PurseImpl_Stub: unsupported parameter ty
    pe String of invoked method <init>(java.lang.String, java.lang.Exception) of cla
    ss java.rmi.UnexpectedException.
    {color}
    conversion completed with 73 errors and 1 warnings.

    It seems there is a variable of type "long" in your applet. The "long" type is not supported by Java Card, so you should remove all variables with type "long".
    Otherwise, without the source code, it is difficult to help you find out what's wrong.

  • Error while creating cap file

    while creating Cap file through converter , error is coming Class helloworld does not belong to this package while giving the same package path where it is existing physically. i m using javacard version 2.2.1 and J2SE 1.4

    Hi Joseph
    Thanks and accept my regards. Now I am able to create the .cap file. but I am facing another problem. I am developing a sim application but I am not able to find the sim.toolkit libraries. Can you plz guide me, where i would find the libraries.

  • Error converting to cap file

    Hello everyone,
    I tried to follow sample of java card kit, but I've got this error when I 'd like to convert class file to cap file with converter.
    Assertion (precondition) [member != null] failed at:
    What's wrong ????
    It's out only jca and exp file but not cap file.
    Could you please tell me how to generate cap file?
    Thank you very much,

    I' m sorry.
    I found this in another topic that I have to compile with jdk1.3.x.
    Thanx,

  • Wrong CAP file version error message

    I'm trying to write a loader application that will send a CAP file into JavaCard, and then install it automatically.
    I have developed my JavaCard Applet by using Eclipse3.1.0 and JCOP30.
    After running my JavaCard Applet by Eclipse, I got its CAP file in folder [b\bin\FVSCardPkg\javacard\[/b]
    But when I run my loader application with this CAP file, the error message will display:
    EX: msg Wrong CAP file version, class class com.ibm.jc.JCException
    Wrong CAP file version
         at com.ibm.jc.CapFile.parseHeader(Unknown Source)
         at com.ibm.jc.CapFile.readCapFile(Unknown Source)
         at com.ibm.jc.CapFile.<init>(Unknown Source)
         at LoaderPkg.loader.load(loader.java:35)
         at LoaderPkg.loader.main(loader.java:20)
    This is my loader application source code:
    import java.io.*;
    import com.ibm.jc.*;
    import com.ibm.jc.terminal.*;
    *  Sample /**
    *  Sample loader. Demonstrates how to use the offcard API to download
    *  a cap-file on a JCOP41V22 Engineering sample card and listing of applets loaded will
    * follow.
    public class loader{
         private final static String termName = "pcsc:4"; // Real card
    //     private final static String termName = "Remote"; // Simulator
         protected static final byte[] JCOP_CARD_MANAGER_AID = { (byte) 0xa0, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00};
         protected static final byte defaultInstallParam[] = { -55, 0 };
         static String[] capFileName={"D:/MyCardPkg.cap"};
         public static void main(String[] args){
              try{
                   loader l = new loader();
                   l.load();
              }catch(Exception e){
                   System.err.println("EX: msg " + e.getMessage() + ", class " + e.getClass());
                   e.printStackTrace(System.err);
              System.exit(0);
              //Likewise for simulation, be patient the port takes time to close.
              //Use command line "netstate" to check the disapperance of the port before
              // activating JCShell command to read the simulated card.
         private loader(){}
         private void load() throws Exception{
              CapFile capFile = new CapFile(capFileName[0], null);
              System.out.println("Package name: " + capFile.pkg);
              byte[][] applets = capFile.aids;
              if ((applets == null) || (applets.length == 0)){
                   throw new RuntimeException("no applets in cap file");
              // Get connection to terminal, take note that jcop.exe is required to be activated
              // in simulation mode.
              System.out.println("Open terminal ...");
              //Make sure that the simulator jcop.exe is activated before unmarking this satement
              //Remember to delete the downloaded applet before running otherwise error is
              //expected if the simulator finds the existence of the applet with the
              //same pakage name ID and AID
              //Issue /close command at "cm" prompt if the card is in use,, ie it should
              //have "-" prompt. Be patient that the port takes time to close. Use command line
              //"netstate" to check the disapperance of the port before running.
              // pcsc:4=Card Terminal  Or  Remote=LocalHost Terminal
              JCTerminal term = JCTerminal.getInstance(termName, null);
              //For real JCOP41V22 card, please unmark this statement and delete the downloaded
              //applet before running. Error expected if the card finds the existence of the applet
              //with the same pakage name ID and AID
              //Issue /close command at "cm" prompt if the card is in use,, ie it should
              //have "-" prompt.
              term.open();
              // Add in this statement for real card which requires some response time
              term.waitForCard(5000);
              // Create a logging terminal spitting out the APDUs on standard out
              TraceJCTerminal _term = new TraceJCTerminal();
              _term.setLog(new PrintWriter(System.out));
              _term.init(term);
              term = _term;
              // Get JavaCard representative, passing NULL resets card and returns ATR
              System.out.println("Get card ...");
              JCard card = new JCard(term, null, 2000);
              // Get the off-card representative for the card manager and use it to
              // select the on-card CardManager
              System.out.println("Select card manager ...");
              CardManager cardManager = new CardManager(card, CardManager.daid);
              cardManager.select();
              // For downloading something, we have to be authenticated to card manager.
              // For this, the keys must be set. The keys to use should of course
              // be configurable as well.
              byte[] dfltKey = c2b("404142434445464748494a4b4c4d4e4f");
              cardManager.setKey(new OPKey(255, 1, OPKey.DES_ECB, dfltKey));
              cardManager.setKey(new OPKey(255, 2, OPKey.DES_ECB, dfltKey));
              cardManager.setKey(new OPKey(255, 3, OPKey.DES_ECB, dfltKey));
              cardManager.setKey(new OPKey(1, 1, OPKey.DES_ECB, c2b("707172737475767778797a7b7c7d7e7f")));
              cardManager.setKey(new OPKey(1, 2, OPKey.DES_ECB, c2b("606162636465666768696a6b6c6d6e6f")));
              cardManager.setKey(new OPKey(1, 3, OPKey.DES_ECB, c2b("505152535455565758595a5b5c5d5e5f")));
              System.out.println("init Update ...");
              cardManager.initializeUpdate(255,0);
              System.out.println("Authenticate to card manager ...");
              cardManager.externalAuthenticate(OPApplet.APDU_CLR);
              // And load the cap-file, do not forget to call installForLoad
              System.out.println("Loading cap-file ...");
              byte[] cardManagerAid = cardManager.getAID();
              cardManager.installForLoad(capFile.pkgId,0, capFile.pkgId.length, cardManagerAid, 0, cardManagerAid.length, null, 0, null, 0, 0, null, 0);
              cardManager.load(capFile, null, CardManager.LOAD_ALL, null, cardManager.getMaxBlockLen());
              byte[] capaid = capFile.aids[0];
              System.out.println("Finished loading !");
              // Install applet, we try to install the first applet given in the
              // cap file, and try to instantiate it under the same AID as given for its
              // representation in the cap file. No installation data is passed.
              System.out.println("Installing applet ...");
              cardManager.installForInstallAndMakeSelectable(capFile.pkgId, 0, capFile.pkgId.length, capaid,0, capaid.length, capaid, 0, capaid.length, 0, defaultInstallParam, 0, defaultInstallParam.length, null, 0);
              System.out.println("Install succeeded!");
              // synchronize state with on-card card manager
              System.out.println("Update!");
              cardManager.update();
              // Print information regarding card manager, applets and packages on-card
              JCInfo info = JCInfo.INFO;
              System.out.println("\nCardManager AID : " + JCInfo.dataToString(cardManager.getAID()));
              System.out.println("CardManager state : " + info.toString("card.status", (byte) cardManager.getState()) + "\n");
              //Echountered error 6A 86 with this statement:Object[] app = cardManager.getApplets(CardManager.GET_APPLETS,
              //CardManager.CVM_FORMAT_HEX, true);
              //Solved the bug by playing the integers in arg0 and arg1.
              Object[] app = cardManager.getApplets(1, true);
              if (app == null) {
                   System.out.println("No applets installed on-card");
              } else {
                   System.out.println("Applets:");
                   for (int i = 0; i < app.length; i++) {
                        System.out.println(info.toString("applet.status", (byte) ((OPApplet) app).getState()) + " " + JCInfo.dataToString(((OPApplet) app[i]).getAID()));
              // List packages on card
              // Encountered error with this statement:Object[] lf = cardManager.getLoadFiles(CardManager.CVM_FORMAT_HEX, true);
              // Solved the bug by setting arg0 = 0,
              Object[] lf = cardManager.getLoadFiles(true);
              if (lf == null) {
                   System.out.println("No packages installed on-card");
              } else {
                   System.out.println("Packages:");
                   for (int i = 0; i < lf.length; i++) {
                        System.out.println(info.toString("loadfile.status", (byte)((LoadFile) lf[i]).getState()) + " " + JCInfo.dataToString(((LoadFile) lf[i]).getAID()));
              term.close();
         static String numbers = "0123456789abcdef";
         private byte[] c2b(String s) {
              if (s == null) return null;
              if (s.length() % 2 != 0) throw new RuntimeException("invalid length");
              byte[] result = new byte[s.length() / 2];
              for (int i = 0; i < s.length(); i += 2) {
                   int i1 = numbers.indexOf(s.charAt(i));
                   if (i1 == -1) throw new RuntimeException("invalid number");
                   int i2 = numbers.indexOf(s.charAt(i + 1));
                   if (i2 == -1) throw new RuntimeException("invalid number");
                   result[i / 2] = (byte) ((i1 << 4) | i2);
              return result;
    How to solve this problem?
    Thank you in advance.

    I'm not understanding if your cap file is in "b\bin\FVSCardPkg\javacard\", then why are you loading "D:/MyCardPkg.cap"?
    The issue isn't with your off card application, but the cap file version. Look at the cap file components in JCVM specification. I believe it's the Header component. The major, minor should match your card but not greater. In other words, your can't load a 2.2 on a 2.1 card, but a 2.1 can load on a 2.2

  • What is the wrong about converting the .class of api of jc to .cap files?

    hi everyone
    l tried to convert the .class filses of api to .cap files,there are some wrongs please help me!
    ___the .opt file:___
    -out JCA CAP EXP
    -exportpath D:\jCDK2_2_1\api_export_files
    -classdir D:\workspace\framework
    framework
    0x0a:0x0:0x0:0x0:0x62:0x1:0x01 1.2
    converter result:
    c:documents and settings\administrator>converter -config d:\workspace\framework\framework.opt
    java card 2.2.1 class files converter ,version 1.3
    copyright 2003 sun microsystems,inc.all rights reserved.use is subject to license terms
    error:javacard.framework.JCSystem:unsupported method modifier native in method isTransient.
    error:javacard.framework.JCSystem:unsupported method modifier native in method makeTransientBooleanArray.
    error:javacard.framework.JCSystem:unsupported method modifier native in method makeTransientByteArray
    error:javacard.framework.JCSystem:unsupported method modifier native in method makeTransientShortArray
    conversion completed with 13 errors and 0 warnings.
    thanks in advance

    Hi,
    I am not sure why you are trying to convert the API packages into CAP files. The JAR files that ship with the JCDK are only stub implementations for compiling against. They do not have an actual implementation. You will find methods returning a short always return 0 etc. You should only need to convert your code into CAP files. You will just need to reference the .exp files that are included in the JCDK for the API so your code can be converted.
    Cheers,
    Shane

  • CAP file generating ERROR

    Hi everybody ,
    I'm trying to build a javacard project by using ANT tool . The problem is when i use the JCOP tool converter (tric.jar) with JRE 1.4 or 1.5 i got the following error :
    Error: class java.lang.RuntimeException, resolving constant-pool of clazz Lhun/eid/javacard/EIDApplet; failed: no such method getClass, ()Ljava/lang/Class; in Ljava/lang/Object;
    and JCOP tool converter with JRE 1.6 , igot another error : invalid magic cafebabe
    After that , i replaced the JCOP tool's converter by using the java_card_kit-2_2_2's converter , and i got another error :
    [java] converting hun.eid.javacard.EIDApplet
    [java] parsing C:\Users\mannykitty\workspace NEW\HUNEID\lib\api_export_files\javacard\framework\javacard\framework.exp
    [java] parsing C:\Users\mannykitty\workspace NEW\HUNEID\lib\api_export_files\javacardx\crypto\javacard\crypto.exp
    [java] error: line 2094: hun.eid.javacard.EIDApplet: method getClass() of class java.lang.Object not found in export file lang.exp or the method signature has changed.
    [java] error: line 2094: hun.eid.javacard.EIDApplet: class java.lang.Class not found in export file lang.exp.
    [java] error: line 2094: hun.eid.javacard.EIDApplet: class java.lang.Class in return type of method java.lang.Object.getClass() not found.
    [java] error: line 2094: hun.eid.javacard.EIDApplet: method getClass() of class java.lang.Object not found in export file lang.exp or the method signature has changed.
    [java] error: line 2094: hun.eid.javacard.EIDApplet: class java.lang.Class not found in export file lang.exp.
    [java] error: line 2094: hun.eid.javacard.EIDApplet: class java.lang.Class in return type of method java.lang.Object.getClass() not found.
    [java] conversion completed with 6 errors and 0 warnings.
    [java] Java Result: 1
    Can someone tell me how to fix this ? Any help will be appreciated !

    I've added the api.jar to class path for compiling but it's seemed not to be changed . Here is my ANT build.xml config :
    <property name="lib" value="lib"/>
         <property name="JCKlibHome" value="c:\Java\java_card_kit-2_2_2\lib"/>
    <property name="JCOPlib" value="${lib}/slbJIop.jar;${lib}/jc_api_212.jar;${lib}/jce1_2_2.jar;${lib}/sunjce_provider.jar"/>
    <property name="JCOPtools" value="${JCKlibHome}/converter.jar;${JCKlibHome}/offcardverifier.jar"/>
    <property name="src" value="src"/>
         <property name="build" value="build"/>
    <property name="classes" value="${build}/classes"/>
    <property name="cardout" value="${build}/card"/>
    <property name="tmp" value="${build}/tmp"/>
    <property name="buildcp" value="${JCOPlib};${JCKlibHome}/api.jar"/>
    Compile :
    <target name="compile" depends="init" description="Compile the javacard source into class files">
    <!-- Compile the java code from ${src} into ${classes} -->
    <javac debug="yes" classpath="${buildcp}" srcdir="${src}" destdir="${classes}"/>
    </target>
    CAP generation:
    <target name="createCAP" depends="compile,capuptodatecheck" unless="capfile.uptodate" description="Create the CAP file from the class files">
    <java classname="com.sun.javacard.converter.Converter" classpath="${JCOPtools}" fork="yes">
         <arg line="-classdir ${classes}" />
         <arg line="-exportpath ${JCOPlib};C:\Java\java_card_kit-2_2_2\api_export_files"/>
         <arg line="-d ${cardout}" />
         <arg line="-v" />
         <arg line="-out CAP EXP JCA" />
         <arg line="-applet 0x41:0x70:0x70:0x68:0x75:0x6e:0x65:0x69:0x64 hun.eid.javacard.EIDApplet hun.eid.javacard 0x41:0x70:0x70:0x68:0x75:0x6e:0x65:0x69:0x64:0x01" />
         <arg line="1.0" />
    ERROR :
    [java] error: line 2094: hun.eid.javacard.EIDApplet: method getClass() of class java.lang.Object not found in export file lang.exp or the method signature has changed.
    [java] error: line 2094: hun.eid.javacard.EIDApplet: class java.lang.Class not found in export file lang.exp.
    [java] error: line 2094: hun.eid.javacard.EIDApplet: class java.lang.Class in return type of method java.lang.Object.getClass() not found.
    [java] error: line 2094: hun.eid.javacard.EIDApplet: method getClass() of class java.lang.Object not found in export file lang.exp or the method signature has changed.
    [java] error: line 2094: hun.eid.javacard.EIDApplet: class java.lang.Class not found in export file lang.exp.
    [java] error: line 2094: hun.eid.javacard.EIDApplet: class java.lang.Class in return type of method java.lang.Object.getClass() not found.
    [java] conversion completed with 6 errors and 0 warnings.
    [java] Java Result: 1
    :(

  • CAP file error

    Hello !!
    I'm using the command verifycap verify the integrity of a CAP file and export files. the problem is that the command returns the following error:
    Error: In class descriptor Descriptor[1]:
    Field number 1:
    Inconsistency on class reference in instance field
    I've seen the docs related to the CAP file format (Java Card 2.1.1 Virtual Machine Specification), but I haven�t found the solution for this problem.
    I would appreciate some help!
    Thanks, Sidney

    There was a bug in cJDK 2.1.1 converter, in descriptor
    component. It was fixed in 2.1.2. I think that you are
    trying to test 'old' cap file.
    Can this error be related to CAP file errormentioned before?
    No, it can't. The descriptor component is not
    installed on card at all. The installer found that you
    are trying to install the package with duplicate AID,
    i.e. card already contains package with this AID.Hello Alb!!
    Thank you for helping me, but I guess the problem's not what you mentioned, cause I'm using the 2.1.2 version. About the duplicate package AID error, the problem can't be an already existing package, cause I haven't downloaded the CAP file to a card yet, I'm just testing it with the jcwde and apdutool. And there's more: even so, I've changed the package AID, and the error succeeded.
    So once more, do you have any suggestion?
    Sidney

  • Install CAP file ERROR "6A 80"

    Hi everyone !
    I created CAP file with java card dev kit 2.1.2 and success to upload on card . But when i tried to install it returned the error 6A 80 (Wrong data) . Here is the error :
    <= 90 00 ..
    Status: No Error
    Load report:
    18048 bytes loaded in 10.3 seconds
    effective code size on card:
    + package AID 7
    + applet AIDs 13
    + classes 67
    + methods 15203
    + statics 254
    + exports 0
    overall 15544 bytes
    => 84 E6 0C 00 24 07 48 55 4E 45 49 44 01 06 48 55 ....$.HUNEID..HU
    4E 45 49 44 06 48 55 4E 45 49 44 01 00 02 C9 00 NEID.HUNEID.....
    00 6A 1D BD 2B 5F BE 82 2A 00 .j..+_..*.
    (1746340 usec)
    <= 6A 80 j.
    Status: Wrong data
    i tried to do the same step with the sample applet in JCK 2.1.2 and they run smoothly .
    Thanks in advance for any help !

    hi
    use install command like this example:
    applet id : a00000006203010c0101 length : 10 decimal 0a hex
    package id : a00000006203010c01 length :9
    80 e6 0c 00 26
    09a00000006203010c01 0aa00000006203010c0101 0aa00000006203010c0101 0100 02c90000

  • Error while converting class file to exp and jca file

    error while converting *.class file to *.exp and *.jca file
    =====================================================================================================================
    linux-y60u:/home/admin/java_card_kit-2_2_1/samples/src # converter -exportpath "/home/admin/java_card_kit-2_2_1/lib/" com/sun/javacard/samples/HelloWorld 0x00:0x01:0x02:0x03:0x04:0x05:0x06:0x07:0x0b 1.0 -v -applet 0x00:0x01:0x02:0x03:0x04:0x05:0x06:0x07:0x0b:0x01 Identity
    Java Card 2.2.1 Class File Converter, Version 1.3
    Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
    parsing /home/admin/java_card_kit-2_2_1/samples/src/com/sun/javacard/samples/HelloWorld/HelloWorld.class
    parsing /home/admin/java_card_kit-2_2_1/samples/src/com/sun/javacard/samples/HelloWorld/Identity.class
    error: com.sun.javacard.samples.HelloWorld.HelloWorld: unsupported class file format of version 50.0.
    error: com.sun.javacard.samples.HelloWorld.Identity: unsupported class file format of version 50.0.
    conversion completed with 2 errors and 0 warnings.
    =====================================================================================================================

    i compile a file javacard use this command:
    ===
    javac -source 1.3 -target 1.1 -g -classpath ./classes:../lib/api.jar:../lib/installer.jar src/com/sun/javacard/samples/Identity/Identity.java
    ===
    and try to convert this class use this command
    ===
    /home/xnuxerx/admin/java_card_kit-2_2_1/bin/converter -exportpath "/home/xnuxerx/admin/java_card_kit-2_2_1/lib/" com/sun/javacard/samples/Identity 0x00:0x01:0x02:0x03:0x04:0x05:0x06:0x07:0x0b 1.0 -v -applet 0x00:0x01:0x02:0x03:0x04:0x05:0x06:0x07:0x0b:0x01 Identity
    ===
    result convert:
    ===
    Java Card 2.2.1 Class File Converter, Version 1.3
    Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
    parsing /home/xnuxerx/admin/java_card_kit-2_2_1/samples/classes/com/sun/javacard/samples/Identity/Identity.class
    converting com.sun.javacard.samples.Identity.Identity
    error: export file framework.exp of package javacard.framework not found.
    conversion completed with 1 errors and 0 warnings.
    ===
    why ??
    please your comment for this problem.
    thank 4 all.

  • How do I convert Wallet.class to a CAP file?

    I was trying to convert one of the sample files( Wallet.class) to a CAP file but it didn't work.
    Please help!!!

    Please be more specific. Describe what you did in detail, provide outputs of your actions etc. Otherwise noone can help you.
    Somebody save the world..

  • Java card cap file install error in jcop tools

    When i try to run java card applet in real java card it gives this error.i used jcop tools and java version 1.5  and eclipse 3.2.when i run the applet in simulater it works fine.i saw some document it says allocate memory for the installation process.i don't know how to do that.
    /term "winscard:4|SCM Microsystems Inc. SCL010 Contactless Reader 0"
    --Opening terminal
    >  /card -a a000000003000000 -c com.ibm.jc.CardManager
    resetCard with timeout: 0 (ms)
    --Waiting for card...
    ATR=3B 8A 80 01 4A 43 4F 50 33 31 56 32 33 32 7A       ;...JCOP31V232z
    ATR: T=0, T=1, Hist="JCOP31V232"
    => 00 A4 04 00 08 A0 00 00 00 03 00 00 00 00          ..............
    (23807 usec)
    <= 6F 65 84 08 A0 00 00 00 03 00 00 00 A5 59 9F 65    oe...........Y.e
        01 FF 9F 6E 06 47 91 73 51 2E 00 73 4A 06 07 2A    ...n.G.sQ..sJ..*
        86 48 86 FC 6B 01 60 0C 06 0A 2A 86 48 86 FC 6B    .H..k.`...*.H..k
        02 02 01 01 63 09 06 07 2A 86 48 86 FC 6B 03 64    ....c...*.H..k.d
        0B 06 09 2A 86 48 86 FC 6B 04 02 15 65 0B 06 09    ...*.H..k...e...
        2B 85 10 86 48 64 02 01 03 66 0C 06 0A 2B 06 01    +...Hd...f...+..
        04 01 2A 02 6E 01 02 90 00                         ..*.n....
    Status: No Error
    cm>  set-key 255/1/DES-ECB/404142434445464748494a4b4c4d4e4f 255/2/DES-ECB/404142434445464748494a4b4c4d4e4f 255/3/DES-ECB/404142434445464748494a4b4c4d4e4f
    cm>  init-update 255
    => 80 50 00 00 08 AC B1 90 01 BF 2D 24 A0 00          .P........-$..
    (49906 usec)
    <= 00 00 91 18 01 39 93 95 05 59 FF 02 00 2C BE 39    .....9...Y...,.9
        5E A5 07 55 87 B8 C3 A8 A6 93 66 2B 90 00          ^..U......f+..
    Status: No Error
    cm>  ext-auth plain
    => 84 82 00 00 10 0C AE 50 3E C8 7E 1D 92 29 E2 59    .......P>.~..).Y
        08 D9 DA 02 16                                     .....
    (57276 usec)
    <= 90 00                                              ..
    Status: No Error
    cm>  delete 060504030201
    => 80 E4 00 00 08 4F 06 06 05 04 03 02 01 00          .....O........
    (40041 usec)
    <= 6A 88                                              j.
    Status: Reference data not found
    jcshell: Error code: 6a88 (Reference data not found)
    jcshell: Wrong response APDU: 6A88
    Ignoring expected error
    cm>  delete 010203040506
    => 80 E4 00 00 08 4F 06 01 02 03 04 05 06 00          .....O........
    (17392 usec)
    <= 6A 88                                              j.
    Status: Reference data not found
    jcshell: Error code: 6a88 (Reference data not found)
    jcshell: Wrong response APDU: 6A88
    Ignoring expected error
    cm>  upload -d -b 250 "Cap File location"
    => 80 E6 02 00 13 06 01 02 03 04 05 06 08 A0 00 00    ................
        00 03 00 00 00 00 00 00 00                         .........
    (32303 usec)
    <= 00 90 00                                           ...
    Status: No Error
    => 80 E8 00 00 FA C4 81 F2 01 00 23 DE CA FF ED 02    ..........#.....
        02 04 00 01 06 01 02 03 04 05 06 12 68 6D 73 2F    ............hms/
        6A 61 76 61 63 61 72 64 2F 68 65 6C 6C 6F 02 00    javacard/hello..
        21 00 23 00 21 00 0A 00 0B 00 1E 00 0E 00 3D 00    !.#.!.........=.
        0A 00 0B 00 00 00 4D 01 BE 00 00 00 00 00 00 01    ......M.........
        01 00 04 00 0B 01 02 01 07 A0 00 00 00 62 01 01    .............b..
        03 00 0A 01 06 06 05 04 03 02 01 00 08 06 00 0E    ................
        00 00 00 80 03 00 FF 00 07 01 00 00 00 1C 07 00    ................
        3D 00 01 10 18 8C 00 05 7A 05 30 8F 00 00 3D 8C    =.......z.0...=.
        00 01 18 1D 04 41 18 1D 25 8B 00 02 7A 02 21 18    .....A..%...z.!.
        8B 00 03 60 03 7A 19 8B 00 04 2D 1A 04 25 73 00    ...`.z....-..%s.
        09 00 00 00 00 00 0F 11 6D 00 8D 00 06 7A 08 00    ........m....z..
        0A 00 00 00 00 00 00 00 00 00 00 05 00 1E 00 07    ................
        01 00 02 00 06 00 00 01 03 80 03 02 03 80 03 03    ................
        03 80 0A 01 06 80 03 00 06 80 07 01 09 00 0B 00    ................
        00 00 07 05 06 04 0A 07 07 13 0B 00 4D 01 00 00    ............M...
    (764519 usec)
    <= 6A 80                                              j.
    Status: Wrong data
    jcshell: Error code: 6a80 (Wrong data)
    jcshell: Wrong response APDU: 6A80
    Unexpected error; aborting execution

    Thanks ReNa
    i am using nxp jcop 31 contact-less card.and it will support for java card 2.2.1 and global-platform card specification 2.1.1 .so i am using nxp jcop training 2007 tools and it has java card 2.2.1 and global-platform card specification 2.1.1.Inside my project there are three jar files these are jc221.jar and gp211.jar and bio10.jar
    i will appreciate your help
    Thanks

  • Upload external  cap file: jcshell: Error code: 6a80 (Wrong data)?

    Hi,
    i use eclipse + NXP JCOP Plugins_Generic3.2.8_Target ,the card is jcop31v232.
    if the cap file is generated by eclipse project , when i upload exteral cap file ,no error
    but if the cap file is generated by converter command ,there is  error
    what error?help me
    cm> /terminal "winscard:4|Feitian R502 Contact Reader 1"
    --Opening terminal
    /card -a a000000003000000 -c com.ibm.jc.CardManager
    resetCard with timeout: 0 (ms)
    --Waiting for card...
    ATR=3B FA 13 00 00 81 31 FE 45 4A 43 4F 50 33 31 56 ;.....1.EJCOP31V
    32 33 32 93 232.
    IOCTL().
    ATR: T=1, FI=1/DI=3 (93clk/etu), N=0, IFSC=254, BWI=4/CWI=5, Hist="JCOP31V232"> => 00 A4 04 00 08 A0 00 00 00 03 00 00 00 00 ..............
    (104154 usec)
    <= 6F 65 84 08 A0 00 00 00 03 00 00 00 A5 59 9F 65 oe...........Y.e
    01 FF 9F 6E 06 47 91 73 51 2E 00 73 4A 06 07 2A ...n.G.sQ..sJ..*
    86 48 86 FC 6B 01 60 0C 06 0A 2A 86 48 86 FC 6B .H..k.`...*.H..k
    02 02 01 01 63 09 06 07 2A 86 48 86 FC 6B 03 64 ....c...*.H..k.d
    0B 06 09 2A 86 48 86 FC 6B 04 02 15 65 0B 06 09 ...*.H..k...e...
    2B 85 10 86 48 64 02 01 03 66 0C 06 0A 2B 06 01 +...Hd...f...+..
    04 01 2A 02 6E 01 02 90 00 ..*.n....
    Status: No Error
    cm> set-key 255/1/DES-ECB/404142434445464748494a4b4c4d4e4f 255/2/DES-ECB/404142434445464748494a4b4c4d4e4f 255/3/DES-ECB/404142434445464748494a4b4c4d4e4f
    cm> init-update 255
    => 80 50 00 00 08 A7 C7 04 88 8C 87 3F DE 00 .P.........?..
    (68417 usec)
    <= 00 00 93 36 01 29 05 95 13 05 FF 02 00 5F E1 48 ...6.)......._.H
    67 60 FD 2F 89 FF AD A4 72 B4 17 E9 90 00 g`./....r.....
    Status: No Error
    cm> ext-auth plain
    => 84 82 00 00 10 17 6D 1C 2A 87 9E 0A 24 3F 15 83 ......m.*...$?..
    A4 84 10 C0 75 ....u
    (71713 usec)
    <= 90 00 ..
    Status: No Errorh1.
    cm> upload -d "D:\JCIDE_workspace\hello\hello\javacard\hello.cap"
    => 80 E6 02 00 12 05 A0 00 01 00 62 08 A0 00 00 00 ..........b.....
    03 00 00 00 00 00 00 00 ........
    (56499 usec)
    <= 00 90 00 ...
    Status: No Error
    => 80 E8 00 00 FF C4 82 01 A1 01 00 0F DE CA FF ED ................
    01 02 04 00 01 05 A0 00 01 00 62 02 00 1F 00 0F ..........b.....
    00 1F 00 0B 00 15 00 2E 00 0C 00 63 00 17 00 12 ...........c....
    00 00 00 6F 00 02 00 01 00 0A 02 01 00 04 00 15 ...o............
    02 03 01 07 A0 00 00 00 62 01 01 00 01 07 A0 00 ........b.......
    00 00 62 00 01 03 00 0B 01 07 A0 00 01 00 62 03 ..b...........b.> 01 00 08 06 00 0C 00 80 03 00 FF 00 07 01 00 00 ................
    > 00 1C 07 00 63 00 01 10 18 8C 00 00 7A 05 30 8F ....c.......z.0.
    > 00 01 3D 8C 00 02 18 1D 04 41 18 1D 25 8B 00 03 ..=......A..%...
    > 7A 02 21 18 8B 00 04 60 03 7A 19 8B 00 05 2D 1A z.!....`.z....-.
    > 04 25 75 00 10 00 01 00 30 00 09 18 19 8C 00 06 .%u.....0.......
    > 70 08 11 6D 00 8D 00 07 7A 05 21 19 8B 00 05 2D p..m....z.!....-
    > 7B 00 08 03 1A 03 7B 00 08 92 8D 00 09 3B 19 03 {.....{......;..
    7B 00 08 92 8B 00 0A 7A 08 00 17 00 02 00 01 00 {......z........
    01 03 00 0A 48 65 6C 6C 6F 57 6F 72 6C 64 00 00 ....HelloWorld..> 00 00 05 00 2E 00 0B 06 80 03 00 01 00 00 00 06 ................
    > 00 00 01 03 00 .....
    >(1200 msec)
    <= 6A 80 j.
    Status: Wrong data
    jcshell: Error code: 6a80 (Wrong data)
    jcshell: Wrong response APDU: 6A80

    thank you. I use jcdk 2.2.1,jcop31v232 supports jc2.2.1 and gp2.1.1
    And i can not understand this:
    your jcop card is not a javacard v3 card.
    cm> /cap-info -p "D:\JCIDE_workspace\hello\hello\javacard\hello\hello" "D:\JCIDE_workspace\hello\hello\javacard\hello.cap"
    jcshell: Cannot read file <D:\JCIDE_workspace\hello\hello\javacard\hello.cap>: Incomplete CAP file, missing mandatory component: Header.capbut there is Header.cap in hello.cap:
    hello/javacard/Header.cap :
    01 00 13 de ca ff ed 01 02 04 00 01 09 a0 00 01
    00 62 03 01 0c 02

  • Error: cannot access class oracle.jsp.runtime.HttpJsp; file oracle\jsp\runtime\HttpJs

    Hello,
    where is now oracle\jsp\runtime\HttpJsp.class located?
    thanks.
    Oleg.

    Same problem,
    Error: cannot access class oracle.jsp.runtime.HttpJsp; file oracle\jsp\runtime\HttpJsp.class not found
    Thanks
    aldo

Maybe you are looking for