[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
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
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