[Urgent]How to use FileAccessCardService,I am getting Exception

Hai to all,

I am using OCF1.2 package with the Omnikey card Reader(cardman 5121 RFID),while i am making to access the FileAccessCardService inside the class as follows

while i am using i am getting Exception as

java.lang.ClassNotFoundException: CardService implementing interface opencard.opt.iso.fs.FileAccessCardService

My code is as follows

[

try

{

Properties sysProp = System.getProperties();

sysProp.put ("OpenCard.terminals", "com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminalFactory");

.

.

.

.

FileAccessCardService facs = (FileAccessCardService)sc.getCardService(FileAccessCardService.class, true);

System.out.println("CardService OK");

CardFile file = new CardFile(facs, "3F00:1012");

byte[] data = facs.read(file.getPath(), 0, file.getLength());

System.out.println(new String(data));

}

my advance thanks for ur quick reply

[976 byte] By [RedRoseDiscussion05a] at [2007-10-2 4:35:29]
# 1

Hi "[Urgent]"

> java.lang.ClassNotFoundException: CardService implementing interface opencard.opt.iso.fs.FileAccessCardService

By the package path "opencard.opt" you can see that this is an optional package of OCF which is therfore located in a seperate JAR (AFAIK the "base-opt.jar"). Adding this jar to your classpath solves this ClassNotFoundException.

BTW: Please use the [ code ] -nvironment for psoting java source code. You can insert it by using the button "code" above the message editor control).

Jan

JPJavaa at 2007-7-16 0:08:00 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 2

Hello!

I am working with Opencard Framework and want to read Data from a SmartCard. I use the CardReader CardMan 3121 (by OMNIKEY).

I want to create an instance of FileAccessCardService:

FileAccessCardService fileService = (FileAccessCardService) card.getCardService(FileAccessCardService.class, true);

But i get an ClassNotFoundException:

ClassNotFoundException:

CardService implementing interface opencard.opt.iso.fs.FileAccessCardService

Could you please help me?

Nice greetings

scheiringaa at 2007-7-16 0:08:00 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 3
Why do you use the Opencard framework? You should avoid this and use PCSC lite for instance.Considering your problem, you should probably add the "not found class" to the classpath.Best regards,Aleksandar
fara0na at 2007-7-16 0:08:00 > top of Java-index,Java Mobility Forums,Consumer and Commerce...