I'm new to developing apps for smart cards.
I'm testing the sample application in the OCF docs but I get the following
error when executing the class file.

opencard.core.util.OpenCardPropertyLoadingException: property file not found
        at
opencard.opt.util.OpenCardPropertyFileLoader.loadProperties(OpenCardProperty
File
Loader.java:158)
        at opencard.core.service.SmartCard.start(SmartCard.java:520)
        at ReadFile.main(ReadFile.java:14)

ReadFile.java

import opencard.core.service.SmartCard;
import opencard.core.service.CardRequest;
import opencard.opt.iso.fs.FileAccessCardService;
import opencard.opt.iso.fs.CardFile;
import opencard.opt.util.OpenCardPropertyFileLoader;

public class ReadFile {

  public static void main(String[] args)
  {
    System.out.println("reading smartcard file...");

    try {
      SmartCard.start();


   // wait for a smartcard with file access support
      CardRequest cr =
        new CardRequest(CardRequest.ANYCARD, null,
FileAccessCardService.class);
      SmartCard   sc = SmartCard.waitForCard(cr);

      FileAccessCardService facs = (FileAccessCardService)
        sc.getCardService(FileAccessCardService.class, true);
      CardFile root = new CardFile(facs);
      CardFile file = new CardFile(root, ":c009");

      byte[] data = facs.read(file.getPath(), 0,
                             file.getLength() );
      sc.close();
      System.out.println("sc closed");

      String entry = new String(data);
      entry = entry.trim();
      System.out.println(entry);

    } catch(Exception e) {
      e.printStackTrace(System.err);

    } finally { // even in case of an error...

      try {
        SmartCard.shutdown();
      } catch(Exception e) {
        e.printStackTrace(System.err);
      }
    }

    System.exit(0);
  }
}

What seems to be the problem?

Melvin Dave P. Vivas
Programmer
Infinit-E Asia, Inc.
25th Flr. IBM Bldg., Eastwood City Cyberpark,
Quezon City, Philippines
Tel. No. 995-7777 loc. 140; 995-8075



---
> Visit the OpenCard web site at http://www.opencard.org/ for more
> information on OpenCard---binaries, source code, documents.
> This list is being archived at http://www.opencard.org/archive/opencard/

! To unsubscribe from the [EMAIL PROTECTED] mailing list send an email
! to
!                           [EMAIL PROTECTED]
! containing the word
!                           unsubscribe 
! in the body.

Reply via email to