This discussion is archived
6 Replies Latest reply: Jul 20, 2012 12:08 PM by 946598 RSS

error with JCOP 3.1.2

946598 Newbie
Currently Being Moderated
I work with eclipse 3.2 and JCOP tool 3.1.2

when I try to run a javacard project on the shell "simulator" i got these result :
- /term "Remote|localhost:49381"
/card -a a000000003000000 -c com.ibm.jc.CardManager
ATR: 3BFA1300008131FE454A434F5034315632323196
ATR: T=1, FI=1/DI=3 (93clk/etu), N=0, IFSC=254, BWI=4/CWI=5, Hist="JCOP41V221"
cm> set-key 255/1/DES-ECB/404142434445464748494a4b4c4d4e4f 255/2/DES-ECB/404142434445464748494a4b4c4d4e4f 255/3/DES-ECB/404142434445464748494a4b4c4d4e4f
cm> init-update 255
cm> ext-auth plain

cm> delete a00002471001
jcshell: Error code: 6a88 (Reference data not found)
jcshell: Wrong response APDU: _6A88_
Ignoring expected error

cm> delete a000024710
jcshell: Error code: 6a88 (Reference data not found)
jcshell: Wrong response APDU: _6A88_
Ignoring expected error

cm> upload -b 250 "C:\Users\Nano\workspace3\passport\bin\nano\javacard\nano.cap"
cm> install -i a00002471001 -q C9#() a000024710 a00002471001
cm> card-info

Card Manager AID : A000000003000000
Card Manager state : OP_READY

Application: SELECTABLE (--------) A00002471001
Load File : LOADED (--------) A0000000035350 (Security Domain)
Module : A000000003535041
Load File : LOADED (--------) A000024710
Module : A00002471001
cm> /terminal "winscard:4|SCM Microsystems Inc. SDI011G Smart Card Reader 0"
jcshell: Cannot init/open terminal: java.lang.ArrayIndexOutOfBoundsException: 955910552
- /terminal "winscard:4|SCM Microsystems Inc. SDI011G Smart Card Reader 0"
jcshell: Cannot init/open terminal: java.lang.ArrayIndexOutOfBoundsException: 955910552

is the underline errors normal ?
------------------------

also when I select an external reader to load the cap to the card, eclipse terminated everytime and give me the following error : ( i use Philips Pegoda Reader )
JVM terminated. Exit code=1
C:\windows\system32\javaw.exe
-Xms40m
-Xmx256m
-jar C:\Users\Nano\Desktop\eclipse\startup.jar
- os win32
-ws win32
-arch x86
-launcher C:\Users\Nano\Desktop\eclipse\eclipse.exe
-name Eclipse
- showsplash 600
-exitdata b44_c4
- vm C:\Windows\System32\javaw.exe
- vmargs
- Xms40m
- Xmx256m
- jar C:\Users\Nano\Desktop\eclipse\startup.jar

please help me , as I use for my graduation project and I am loosing time trying to solve it :(
  • 1. Re: error with JCOP 3.1.2
    Lyolik Newbie
    Currently Being Moderated
    1)
    After last command:

    cm> card-info

    You should send command "/close" to exit from CardManager. After that you will be able reconnect with command "/terminal "winscard:4|SCM Microsystems Inc. SDI011G Smart Card Reader 0"".

    2)
    Try issue a simple command "/term" without parameters instead of selecting an external reader.

    Edited by: Lyolik on 19.07.2012 6:27
  • 2. Re: error with JCOP 3.1.2
    946598 Newbie
    Currently Being Moderated
    thanks ,

    I solved the problem I change the vm to 1.5

    however I know have another problem, everything goes fine in the simulation
    but when I run it and choose a real card JCOP 31 it gives me the following:

    - /term "winscard:4|SCM Microsystems Inc. SDI011G Smart Card Reader 0"
    /card -a a000000003000000 -c com.ibm.jc.CardManager
    ATR: 3BFA1800008131FE454A434F5033315632333298
    ATR: T=1, FI=1/DI=8 (31clk/etu), N=0, IFSC=254, BWI=4/CWI=5, Hist="JCOP31V232"
    cm> set-key 255/1/DES-ECB/404142434445464748494a4b4c4d4e4f 255/2/DES-ECB/404142434445464748494a4b4c4d4e4f 255/3/DES-ECB/404142434445464748494a4b4c4d4e4f
    cm> init-update 255
    cm> ext-auth plain
    cm> delete a00002471001
    jcshell: Error code: 6a88 (Reference data not found)
    jcshell: Wrong response APDU: 6A88
    Ignoring expected error

    cm> delete a000024710
    jcshell: Error code: 6a88 (Reference data not found)
    jcshell: Wrong response APDU: 6A88
    Ignoring expected error

    cm> upload -b 250 "C:\Users\Nano\workspace3\epassport\bin\nano\javacard\nano.cap"
    jcshell: Error code: 6a80 (Wrong data)
    jcshell: Wrong response APDU: 6A80
    Unexpected error; aborting execution

    what's the problem here ? and why the same applet can be run successfully on the simulator but can't load to a real card ?
    I found a thread with the same problem but without answers :(
    https://kr.forums.oracle.com/forums/thread.jspa?threadID=1750330
  • 3. Re: error with JCOP 3.1.2
    893199 Explorer
    Currently Being Moderated
    Well the simulator is for a JCOP41 and your card is a JCOP31.

    There are a couple of things that tend to cause this type of problem. Usually its something like uploading an applet that was created using a new JDK and forgetting to specify "-target <card appropriate jdk>". Sometimes its imports of libraries that existed in the simulator, but not in the card.

    And sometimes it's doing something wrong as part of the applet register method.

    Try building the helloworld applet and uploading it. If that works, you've mostly eliminated the build process and can look at things like imports.
  • 4. Re: error with JCOP 3.1.2
    946598 Newbie
    Currently Being Moderated
    thanks a lot
    yes the hello world applet can be uploaded
    but how can I know whether the simulator is for 41 or for 31 ? I am really newbie :)
    isn't both of them compliant to JavaCard Standard 2.2.1. and GlobalPlattform 2.1.1 ?
  • 5. Re: error with JCOP 3.1.2
    893199 Explorer
    Currently Being Moderated
    Take a look at the historical bytes from the ATR - the simulator returns JCOP41V221, your card returns JCOP31V232.

    Both the cards are JC2.2.1 and GP 2.1.1, but JCOP V221 is different than JCOP V232. There are some functions available on 232 that are not available on 221 and vice versa.


    The fact that you can load the helloWorld applet suggests that the problem is in your applet. Take a look at your constructor function and insert an ISOException.throwIt(<some error>) at some point in that function. If you get that error, then the cause is after, otherwise it's before. Lather, rinse repeat (e.g. move the exception the appropriate direction and try again).
  • 6. Re: error with JCOP 3.1.2
    946598 Newbie
    Currently Being Moderated
    but the applet is a sample applet ! and it runs perfectly on the simulator ! and the cap file have been generated as well.
    it just can't be run and loaded to the card
    is it possible that the applet have something wrong after that ?

    and I can upload the hello world applet ONLY if I change the global platform to 2.0.1 and the JC to 2.1.1 and not in case gp is 2.1.1 & JC 2.2.1 !

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points