NOClassDefFoundError:  Listing   ----in applet

hi,
i got this typep of ERROR not exception what it mean
plz, i am waithing here
<applet code=aviplay.class widht=300 height=300 >
<param name="File" value="mpgFile.mpeg">
<applet > */
import java.applet.*;
import javax.media.*;
import java.awt.*;
import java.io.*;
import java.net.*;
import javax.media.protocol.*;
public class aviplay extends java.applet.Applet implements ControllerListener {
Player player = null;
URL url = null;
String fileName = null;
DataSource ds = null;
public void init() {
MediaLocator ml = new MediaLocator("F:\\Param\\player 06-11\\recycleW.wav");
System.out.println("the protocol going to used "+ml.getProtocol());
System.out.println("the protocol removed string "+ml.getRemainder() );
try{
url = new URL(getDocumentBase(),(String)getParameter("File"));
try{
ds = Manager.createDataSource(url);
}catch(IOException e)
System.out.println("EXCEPTION "+e);
try{
player = Manager.createRealizedPlayer(ds);
}catch(NoPlayerException npe)
System.out.println("The exception for no player "+npe);
}catch(CannotRealizeException cre)
System.out.println("The exception for no player "+cre);
}catch(IOException ioe)
System.out.println("The exception for no player "+ioe);
}catch(Exception e)
System.out.println("EXCEPTION "+e);
public void start()
public void stop()
public void destroy()
public synchronized void controllerUpdate(ControllerEvent e)

Since you use the applet tag I am assuming the msjvm runs your applet, you should compile it in the
following way:
javac -tartget 1.1 *.java
If that is not the case than the applet tag must be wrong:
http://java.sun.com/docs/books/tutorial/applet/appletsonly/appletTag.html
This is an old page, where it says applet it should say object.

Similar Messages

  • List in Applet URGENT

    In Java applet how do I set the size for a list.

    <applet code="test.tstapplet" archive="../deploy/showj.jar">
    </applet>
    Try to open it with Firefox or Mozilla (you can be sure MSJVM does not try to open
    the applet).
    When it works convert the html page with [jdk.home]\bin\htmlconverter.exe

  • SOS, how to make hot link by text ,not button or list in applet

    Now i m making one applet, have 12 months histogram figure, there is 1,2,3,....12 month below
    the histogram, when i hit one number, i can get to one month page, example, i hit 1 month, i
    can get to i month's page there are 31 days in january.
    through jdk document, i know the showDocument(URL ur,String target) method just permit Button and List do,other not do.
    how i can hit text to link?

    hi, watertownjordan, i follow your method, do that like the following,
    but running-error,and nothing do!
    can u give me a example?
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.URL;
    public class Test extends Applet{
    public void init() {
    //resize(250,250);
    // HyperLink hy=
    try{
    HyperLink hy=new HyperLink("first",new URL("http://211.152.130.189:8001"),this);
    add(hy);
    }catch(Exception e){}
    class HyperLink extends Label implements MouseListener {
    URL theLink;
    Applet that;
    public HyperLink(String text, URL link,Applet that)
    super(text);
    this.that=that;
    theLink = link;
    addMouseListener(this);
    public void mouseClicked(MouseEvent e)
    that.getAppletContext().showDocument(theLink);
    public void mousePressed(MouseEvent e) {}
    public void mouseReleased(MouseEvent e) {}
    public void mouseEntered(MouseEvent e) {}
    public void mouseExited(MouseEvent e) {}

  • Disable the List Accounts Applet.

    I want to disable the List Accounts link on the Accounts tab and have the Accounts tab redirect you to the Find user menu. Is this possible and how do you do it? The applet is very slow when multiple users are listed at the top. I was able to edit the list.jsp so the applet would not be called. However, i would prefer to have the accounts link go directly to the find user menu and then remove the list accounts menu option. If you have any ideas please let me know.
    Thanks

    Edit the UserUIConfig object.
    Near the end of the UserUIConfig.xml file find the following tag:
    <UserListViewer>
    <String>treetable</String>
    </UserListViewer>
    Edit and set it as:
    <UserListViewer>
    <String>find</String>
    </UserListViewer>
    This will redirect the user to 'Find Users' page. The applet is really pathetic :(
    Thanks,
    Anand

  • NoClassDefFoundError  when loading Applets from IIS5.0

    Hi
    I am having trouble loading applets from IIS 5.0. Here is my html code
    <applet code="Appli/Loader.class" width="100%" height="100%">
    </applet>
    All my clases and packages reside in the same directory from where this html is loaded.
    The trouble is that it behaves erratically. At times the Applet works fine and at times, the browser cannot locate some class.
    The funny part is this behaviour is not consistent. Some times the browser is able to load all the classes and the applet function very well.
    Any suggestion/advice/tip will be great help
    Thanks

    Add the codebase parameter and see if it works.
    <applet code="Appli/Loader.class" codebase="DIRECTORY_WHERE_YOUR_CODE_RESIDES" width="100%" height="100%">
    </applet>

  • Listing applets on the card

    hi,
    I am trying to list the applets present on the card. But, I am getting the following error mesg. The source code is also pasted below.
    C:\J2SDK1.4.0_03\BIN\java.exe ReadFile
    initializing file...
    Before start
    After start
    After Card request
    [INFO     ] opencard.core.service.CardServiceRegistry.getCardServiceClass
    --- message no CardService for interface opencard.opt.applet.mgmt.AppletAccessCardService
    --- thread Thread[Thread-1,5,main]
    --- source opencard.core.service.CardServiceRegistry@422ede++ registered factory opencard.opt.util.PassThruCardServiceFactory@3c5982
    [INFO     ] opencard.core.service.CardServiceRegistry.isCardRequestSatisfied
    --- message requested CardService class interface opencard.opt.applet.mgmt.AppletAccessCardService not supported for opencard.core.terminal.CardID@820dda ATR: 3B 75 94 00 00 62 02 02 02 01
    --- thread Thread[Thread-1,5,main]
    --- source opencard.core.service.CardServiceRegistry@422ede++ registered factory opencard.opt.util.PassThruCardServiceFactory@3c5982
    [INFO     ] opencard.core.service.CardServiceRegistry.getSmartCard
    --- message CardRequest opencard.core.service.CardRequest@186fab NEWCARD
    service = interface opencard.opt.applet.mgmt.AppletAccessCardService cannot be satisfied with opencard.core.terminal.CardID@820dda ATR: 3B 75 94 00 00 62 02 02 02 01
    --- thread Thread[Thread-1,5,main]
    --- source opencard.core.service.CardServiceRegistry@422ede++ registered factory opencard.opt.util.PassThruCardServiceFactory@3c5982
    The source code:
    import opencard.core.service.SmartCard;
    import opencard.core.service.CardRequest;
    import opencard.opt.util.PassThruCardService;
    import opencard.opt.applet.BasicAppletCardService;
    import opencard.opt.iso.fs.CardFile;
    import opencard.core.terminal.*;
    import opencard.opt.applet.mgmt.*;
    import opencard.opt.applet.*;
    public class ReadFile {
         public static void main(String[] args)
              System.out.println("initializing file...");
         try {
              System.out.println("Before start");
              SmartCard.start();
              System.out.println("After start");
              // wait for a smartcard with file access support
              CardRequest cr = new CardRequest(CardRequest.NEWCARD, null, AppletAccessCardService.class);
              System.out.println("After Card request");
              SmartCard sc = SmartCard.waitForCard(cr);
              System.out.println("After waiting for card");
         AppletInfo [] templates = null;
         try {
         AppletAccessCardService aacs = null;
         aacs = (AppletAccessCardService)
         sc.getCardService(AppletAccessCardService.class, true);
         templates = aacs.list();
         } catch (Exception e) {
              sc.close();           
         catch (Exception e)
              e.printStackTrace(System.err);
              System.exit(0);
         finally
         { // even in case of an error...
              try {
                   SmartCard.shutdown();
              catch (Exception e)
              e.printStackTrace(System.err);
         System.exit(0);
    It would be of great help if anyone has code for reading list of applets from the card. We are using CyberFlex egate card and Reflex V2 USB reader.
    Thanks
    Nagesh

    JoesephSmith (and DurangoVa, if your still around),
    Please excuse my previous posts. I was in a sour mood when I wrote them, born out of frustration with trying to get answers from this list and the internet in general.
    JS, I have no personal problem with you at all. You were in the wrong place at the wrong time:
    I had been searching for answers to my query about AppletAccessCardService implementations for a few hours. No information on the OCF site. Little or no information here. During my searching, a great many posts with similar questions came up and, it seemed, the answer that seemed to come up was "RTFM" or "Do a search, this has been answered a million times" (yet the original answer never seemed to appear in the search). While I admit in some instances, this kind of answer might have been correct for that particular user, it wasn't helping me solve my problem. Many years on Slashdot, K5 and IRC has really made me despise that saying -"RTFM". I was upset that the OCF would publish a "Programmers Guide" with sample code that cannot possibly be run or used and I was upset that I could not find the appropriate information on the JavaCard forum here at Sun. A bad day all around.
    Then I came upon this post and the other that you responded to and I just flipped. Sorry about that. Let's try this again:
    While I agree that you cannot list applets without using the GP/OP to do an xauth first, knowing that will not help this individual in this instance. This particular error is caused not having an AppletAccessCardService implementation configured in his opencard.properties file. Without obtaining the proper card service, he cannot get a handle on the smarcard object or a handle on the cardchannel to which he will need to send the xauth commands, then the applet listing commands. So knowing how to do xauth according to GP won't help him if he can't send the commands to the card.
    I would suggest that he forget about the AppletAccessCardService, since there doesn't seem to be an implementation of it around, and use the PassThroughCardService instead. This is a little more low-level than the OCF applet packages (he will have to work directly with APDU commands instead of a wrapper class), but at least he can xauth and list with this one. And as you said JS, you must learn how to do the xauth <i>properly</i> first or you will bugger your card.
    I hope this is a more appropriate response.
    I hope this makes up somewhat for my poor behaviour the other day.
    Be well.

  • JAR file does not get uploaded to client for my SERVLET generated APPLET

    Some help please...
    I have a servlet that generates the HTML code that contains an APPLET. This APPLET needs a JAR file that is listed under its ARCHIVE property. The SERVLET is in a JAR file that is in the same directory as the other needed JAR file. If I create a static HTML with the output of the SERVLET it works fine. But if go through Weblogic the needed JAR file does not get uploaded to the client so I get a java.lang.NoClassDefFoundError:and my APPLET does not load.
    Q1: I am not sure what to put under the CODEBASE tag. I tried "." and I also tried "http://mymachine" but both did not work. I also tried without the CODEBASE tag. No luck. The SERVLET is bound to http://mymachine/servlet.
    Q2: Does anyone have any suggestions on how to do this? Is there a way to force the browser to upload a certain JAR file?
    Thanks...

    It works!!
    This is what I did:
    The jar file in question was the weblogic.jar. I tried putting it under the lib directory of my war file but I had problems because the weblogic.jar contains other war files inside so when I tried to deploy my war file it also tried to deploy the inner war files which for some reason did not work. So I tried removing the war files from the weblogic.jar and this time I had no problems deploying my war file but I still could not find the classes I needed. So I tried moving the weblogic.jar to the root dir of my war file and it worked!! Now the trick here was: I did not set the CODEBASE AND I had the ARCHIVE paramenter set in TWO places like below:
    <APPLET CODE = "marketmap.client.MarketMapApplet"
    ARCHIVE = "weblogic.jar"
    WIDTH = "657"
    HEIGHT = "382"
    ALIGN = "BOTTOM"
    ALT = "APPLET tag not recognized">
    </XMP>
    <PARAM NAME = CODE VALUE = "MyApplet" >
    <PARAM NAME = "type" VALUE="application/x-java-applet;version=1.2.2">
    <PARAM NAME = "scriptable" VALUE="false">
    <PARAM NAME = ARCHIVE VALUE="weblogic.jar">
    </APPLET>
    Actually if you do not place a parameter named ARCHIVE (at the end) it wil NOT work. I tried with multiple jar files listed and it works great too.
    Anyway I figure I'd share. Thanks for the help too.
    Lastly for people who choose not to upload the jar files to clients, you should look at the bea documentation on applets. It lists a classpath servlet that allows you to provide classes to the clients without having to force them to download the jar file.

  • Reinitialization of static data by multiple applets

    Hi,
    I have a problem with initialization of shared static data by multiple applets. I have three applets running inside of different HTML frames in a multi-frame HTML framework. Applets are loaded as JAR files. In addition, every applet has one or two 3rd party JARs listed in the APPLET tag. Applets share the same codebase and run inside the same JVM.
    I use static data to perform the inter-applet communication. This is simply a static list of applet references that is being maintained in the base applet class (all applet classes are inherited from that class). The problem is that when applets get constructed, the static data in the base class sometimes gets reinitialized multiple times. As I understand, the static data should be initialized just once on initial load of the base applet class (applets have the same codebase).
    This problem seems to be caused by the race condition (applets initialize on different threads launched by the browser). Under some circumstances (I change the number and order of JARs, etc.) everything works fine. I can reproduce this problem on both Explorer 5.x and Netscape 4.7 (did not try others). I run applets using native browser's JVM.
    Has anybody had such problem before? Is it caused by the large number of JARs ? Is there any way to guarantee that static data will be initialized once in the multi-applet environment ?
    Thanks,
    hparfen

    Hi,
    Did you find something to solve your problem because I have exactly the same.
    Tony

  • Problem Installing the loaded applet in Samsung java card (S3CC9P9).

    Hi all,
    Am trying to install the applets already loaded into the Samsung java card(S3CC9P9), because am unable to select the applet which are loaded into the card. I got to know that the applets are only loaded, they are not installed in the card, without installing the applet ,we cannot select the applet. Am using gpj(version 20120310 ) to install the applets into the card.
    When i execute : java -jar gpj.jar -list
    i get the list of applets in the card as :
    AID: A0 00 00 00 03 00 00 00 |........| ISD LC: 1 PR: 0x1A
    AID: A0 00 00 00 03 10 |......| Exe LC: 1 PR: 0x00
    AID: D4 10 65 09 90 00 10 00 |..e.....| Exe LC: 1 PR: 0x00
    AID: 31 50 41 59 2E |1PAY.| Exe LC: 1 PR: 0x00
    AID: D4 10 65 09 90 00 30 00 |..e...0.| Exe LC: 1 PR: 0x00
    AID: D4 10 65 09 90 00 20 00 |..e... .| Exe LC: 1 PR: 0x00
    Here am able to select only the first applet i.e., A0 00 00 00 03 00 00 00
    SO, when i try to install the other applets, for example A0 00 00 00 03 10, its fails.
    When i execute : java -jar gpj.jar -install -applet A00000000310
    i get :
    Found terminals: [PC/SC terminal ACS ACR38U 00 00]
    Found card in terminal: ACS ACR38U 00 00
    ATR: 3B 69 00 00 80 63 31 46 DF 83 FF 90 00
    DEBUG: Command APDU: 00 A4 04 00 07 A0 00 00 01 51 00 00
    DEBUG: Response APDU: 6A 82
    Failed to select Security Domain GP211 A0 00 00 01 51 00 00 , SW: 6A 82
    DEBUG: Command APDU: 00 A4 04 00 08 A0 00 00 00 18 43 4D 00
    DEBUG: Response APDU: 6A 82
    Failed to select Security Domain GemaltoXpressPro A0 00 00 00 18 43 4D 00 , SW: 6A 82
    DEBUG: Command APDU: 00 A4 04 00 08 A0 00 00 00 03 00 00 00
    DEBUG: Response APDU: 6F 19 84 08 A0 00 00 00 03 00 00 00 A5 0D 9F 6E 06 10 01 76 DE 00 05 9F 65 01 7F 90 00
    Successfully selected Security Domain OP201a A0 00 00 00 03 00 00 00
    DEBUG: Command APDU: 80 50 00 00 08 AE 2A B8 CE 3A BB E0 B0
    DEBUG: Response APDU: 00 00 61 41 01 09 38 2F 09 5A FF 01 3F D9 93 D9 FE 9A FA 3B E4 B7 21 89 6A 34 AB 18 90 00
    DEBUG: Command APDU: 84 82 00 00 10 A2 63 07 96 0B D8 A3 A9 93 A2 5C 7C 6D B7 E0 54
    DEBUG: Response APDU: 90 00
    DEBUG: Command APDU: 84 82 00 00 08 A2 63 07 96 0B D8 A3 A9
    DEBUG: Response APDU: 90 00
    java.lang.NullPointerException
         at net.sourceforge.gpj.cardservices.GlobalPlatformService.installAndMakeSelecatable(Unknown Source)
         at net.sourceforge.gpj.cardservices.GlobalPlatformService.main(Unknown Source)
    Can anyone please tell me where am wrong and how to make the applets selectable.
    Thanks in advance

    hy
    1. do you have a reader with a serial (com1) connection?
    if so, the reader has to be connected before starting windows. so windows recognizes it.
    2. have a look to the control panel. is there a tool - installed during driver installation - to test and configure the reader?
    if so try it.
    if all that works, the jcop tools communicate with the reader over the installed driver.
    snoopy

  • How to read an information about all installed JavaCard applets?

    Hello!!!
    I wanna ask, is there some way to determine what applets are installed on any JavaCard? I have jcop10 test card and wanna know what's inside...
    Thanks!
    Eugene.

    humm, i'm sorry Get Data with the tag 9F7F is to get the CPLC data. To get the
    list of the packages AID and applets AID on card, you need to send a Get Status
    command:
    this one will retrieve the list of packages AID: 80F24000024F00
    this one will retrieve the list of applets AID: 80F22000024F00
    You may check however in OP specs for more details. Maybe i have inverted to two.
    Thomas
    http://jaccal.sourceforge.net/

  • Applets in JDeveloper 10G

    I am trying the JDeveloper 10G and am new with it. When I look at the help to create a simple applet, the help in creating an applet asks me to go through the following:
    (1) In the Navigator, select a new project.
    (2) Choose File|New to opne the New Gallery,
    (3) In the Categories tree, select Client Tier and then Swing/AWT.
    (4)In the Items list, click "Applet".
    At the last step, Swing/AWT option does not provide an "Applet" item. What am I doing wrong?

    Hi,
    1. Swing Applets can be build by selecting "All Technologies" as the filter for teh New Galery (popup dialog on top) and then navigating to Web Tier --> Applet.
    It seems that you are hitting a documentation bug carried over from an earlier release of JDeveloper.
    2. JClient Applets are supported through the "Form" entry in the "Swing/JClient for ADF" selection. This creates a JClient form based on a Business Component module.
    Frank

  • Applet Selection Problem

    Hi folks;
    I implemented my code by using cref simulator and it is working perfectly, but when I try to make use of actual smartcard environment I got several errors. So, I decided to divide problem into little pieces and start everything from the beginning. For that purpose I sent select installer command;
    powerup;
    0x00 0xA4 0x04 0x00 0x09 0xa0 0x00 0x00 0x00 0x62 0x03 0x01 0x08 0x01 0x7F;
    powerdown;
    to my smartcard reader and still getting errors such that;
    Java Card 2.2.2 APDU Tool, Version 1.3
    Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
    WARNING: PC/SC is not officially supported and may not work on all platforms.
    Before SCardEstablishContext ...
    After SCardEstablishContext ...
    SUCCESS ...-855572480
    Reader 0 : Precise Biometrics Precise 250 MC 0
    NativeConnect Context is ... -855572480
    NativeConnect card is ... ea010000
    NativeStatus card is ... ea010000
    Received ATR = 0x3b 0xff 0x13 0x00 0xff 0x80 0x31 0xfe 0x45 0x53 0x46 0x53 0x45
    0x2d 0x43 0x58 0x33 0x32 0x32 0x2d 0x56 0x18 0x03 0x08 0x77
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 14
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 00, INS: a4, P1: 04, P2: 00, Lc: 09, a0, 00, 00, 00, 62, 03, 01, 08, 01, Le: 00, SW1: 6a, SW2: 82
    NativeDisconnect is ... ea010000
    Is there anybody who could guide me?
    Thanks for further helps...

    Hi
    i am able to list the applets but when trying to install applet on the javacard, i got an error
    ====================
    Listing - successful
    ====================
    D:\SmartCardTools\GPShell-1.4.2\GPShell-1.4.2>gpshell list.txt
    mode_201
    enable_trace
    establish_context
    card_connect
    * reader name SCM Microsystems Inc. SDI010 Contactless Reader 0
    select -AID a0000000030000
    Command --> 00A4040007A0000000030000
    Wrapped command --> 00A4040007A0000000030000
    Response <-- 6F198408A000000003000000A50D9F6E0640513085301A9F6501FF9000
    open_sc -security 1 -keyind 0 -keyver 0 -mac_key 404142434445464748494a4b4c4d4e4
    f -enc_key 404142434445464748494a4b4c4d4e4f // Open secure channel
    Command --> 8050000008A2E775EB7676F4DF00
    Wrapped command --> 8050000008A2E775EB7676F4DF00
    Response <-- 00008088000000020000FF01404524F8EEF1BF349D69E5AC1FF3F8389000
    Command --> 8482010010B325D75313E9E5B960245D57994FC131
    Wrapped command --> 8482010010B325D75313E9E5B960245D57994FC131
    Response <-- 9000
    get_status -element e0
    Command --> 80F2E000024F0000
    Wrapped command --> 84F2E0000A4F0042C1CF26CFE70A4700
    Response <-- 08A000000003000000019E0845726963204C6972070407A0000000620001010007A
    0000000620101010007A0000000620102010007A0000000620201010007A00000000300000100066
    565667265650100066D6966617265010005457269632001009000
    OP201_get_status() returned 10 items
    List of applets (AID state privileges)
    a000000003000000 1 9e
    45726963204c6972 7 4
    a0000000620001 1 0
    a0000000620101 1 0
    a0000000620102 1 0
    a0000000620201 1 0
    a0000000030000 1 0
    656566726565 1 0
    6d6966617265 1 0
    4572696320 1 0
    card_disconnect
    release_context
    ====================
    Listing - Error
    ====================
    D:\SmartCardTools\GPShell-1.4.2\GPShell-1.4.2>gpshell helloinstall.txt
    mode_201
    enable_trace
    establish_context
    card_connect -readerNumber 1
    * reader name SCM Microsystems Inc. SDI010 Contactless Reader 0
    select -AID a0000000030000
    Command --> 00A4040007A0000000030000
    Wrapped command --> 00A4040007A0000000030000
    Response <-- 6F198408A000000003000000A50D9F6E0640513085301A9F6501FF9000
    open_sc -security 1 -keyind 0 -keyver 0 -mac_key 404142434445464748494a4b4c4d4e4
    f -enc_key 404142434445464748494a4b4c4d4e4f // Open secure channel
    Command --> 8050000008A321C159FDD9C0AA00
    Wrapped command --> 8050000008A321C159FDD9C0AA00
    Response <-- 00008088000000020000FF0137020C24D5EA91376793D72962226A149000
    Command --> 8482010010C15CB337C29D001F2F72D65CACD79C62
    Wrapped command --> 8482010010C15CB337C29D001F2F72D65CACD79C62
    Response <-- 9000
    install -file CardEdgeII.ijc -nvDataLimit 12000 -instParam 00 -priv 2
    file name CardEdgeII.ijc
    Command --> 80E602001B05A00000000107A0000000030000000AEF08C6023100C8022EE00000
    Wrapped command --> 84E602002305A00000000107A0000000030000000AEF08C6023100C8022E
    E000A2285BCAF34F976300
    Response <-- 6A80
    install_for_load() returns 0x80206A80 (6A80: Wrong data / Incorrect values in co
    mmand data.)
    Please help and also
    Pls give the url for JCOP download....
    thanks

  • Problems with Wallet application

    When I run the compiled file Wallet.java downloaded from java.sun.com I get a curious error:
    NoClassDefFoundError javacard/framework/Applet.class
    I have installed the JavaCard 2.2, and the demos are running pretty good.
    Yours sincerelly, Serghei.

    If the demos run fine, then how do you get this error ? ?
    It appears that you are trying to run the Wallet.class. You can't execute it because the JC implementation exist on card. That's why Applet.class isn't found. It doesn't exist.
    Review the demo bat file.

  • Need code help

    Could somebody add an OK button to this code so that when it is clicked a dialog box would pop-up stating the name and which options were selected? Thanks.
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
      <applet code="Lister" width=300 height=180>
      </applet>
    public class Lister extends Applet implements ActionListener
    List os, browser;
    String msg = "";
    public void init()
       os = new List (4, true);
       browser = new List (4, false);
       os.add("Windows 98");
       os.add("Windows NT/2000");
       os.add("Solaris");
       os.add("MacOS");
       browser.add("Netscape 1.1");
       browser.add("Netscape 2.x");
       browser.add("Netscape 3.x");
       browser.add("Netscape 4.x");
       browser.add("Internet Explorer 3.0");
       browser.add("Internet Explorer 4.0");
       browser.add("Internet Explorer 5.0");
       browser.add("Lynx 2.4");
       add(os);
       add(browser);
       os.addActionListener(this);
       browser.addActionListener(this);
       public void actionPerformed(ActionEvent ae)
         repaint();
        public void paint(Graphics g)
          int idx[];
          msg = "Current OS: ";
          idx = os.getSelectedIndexes();
          for(int i=0; i<idx.length; i++)
          msg += os.getItem (idx) + " ";
    g.drawString(msg, 6, 120);
    msg = "Current Browser: ";
    msg += browser.getSelectedItem();
    g.drawString(msg, 6, 140);

    This works
    import java.applet.Applet;
    import java.awt.BorderLayout;
    import java.awt.Button;
    import java.awt.Graphics;
    import java.awt.List;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    <applet code="Lister" width=300 height=180>
    </applet>
    public class Lister extends Applet implements ActionListener
    List os, browser;
    String msg = "";
    public void init()
    os = new List (4, true);
    browser = new List (4, false);
    os.add("Windows 98");
    os.add("Windows NT/2000");
    os.add("Solaris");
    os.add("MacOS");
    browser.add("Netscape 1.1");
    browser.add("Netscape 2.x");
    browser.add("Netscape 3.x");
    browser.add("Netscape 4.x");
    browser.add("Internet Explorer 3.0");
    browser.add("Internet Explorer 4.0");
    browser.add("Internet Explorer 5.0");
    browser.add("Lynx 2.4");
    Button button = new Button("OK");
    add(os);
    add(browser);
    add(button,BorderLayout.SOUTH);
    os.addActionListener(this);
    browser.addActionListener(this);
    button.addActionListener(this);
    public void actionPerformed(ActionEvent ae)
    repaint();
    public void paint(Graphics g)
    int idx[];
    msg = "Current OS: ";
    idx = os.getSelectedIndexes();
    for(int i=0; i<idx.length; i++)
    msg += os.getItem (idx) + " ";
    g.drawString(msg, 6, 120);
    msg = "Current Browser: ";
    msg += browser.getSelectedItem();
    g.drawString(msg, 6, 140);

  • 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

Maybe you are looking for

  • Adobe air with flex, file new, open and save for Desktop software program

    I already have a headache from all the searching. I cannot believe this to be such a confusing topic as every software program we create must be able to save user input, right. Here is the problem: Novel writing software program Main window has tabna

  • Lack of customer service/support

    In May of 2011, I purchased a ThinkPad for my son to take to college.  With it, we paid extra for a warranty that we thought would ensure that he would be taken care of, if any problems with the computer came up.  In November, the computer ceased wor

  • Duplex printing by hand

    Want to print 77 pages, duplex. Must simply place the printed odd pages in the input. Printer hangs, nothing happened. I have given the "go on" monitor after replacing the paper. There is one thing what I consider not so normal. The printer halted in

  • U330P Touchpad - Problem beim scrollen

    Hallo, ich habe per google und hier im Forum leider nichts finden können. Folgendes Problem, ich habe ein IdeaPad U330P. Allgemein bin ich sehr zufrieden mit dem Laptop. Allerdings wenn ich mit zwei Fingern scrolle funktioniert dies im mittlerem Bere

  • How to maintain the maintainence dialog for a Ztable?

    Hi all, I created a Ztable in the database and it looks good. But when i am trying to use SM30 T-code and trying to enter the Ztable name and click on the Maintain tab...i get a message called "The maintenance dialog for ZCUSTUM_TABLE is incomplete o