Hi!

I found the answer to my problem among OCF mailing list archives and I 
would like to share it with everyone because many people might be having 
the same problem.

In practice, all I had to do was to replace 
"reference-terminals-windows.jar" by "pcsc.jar" (see attach).

For more details, see:

http://www.opencard.org/archive/opencard/1768.html

I just don't understand why IBM doesn't make this patched version their 
official reference distribution... It would save us a lot of time!

Cheers,

Sergio Saad

Sergio Saad wrote:

> Can anybody help me with this please?
> 
> I'm using:
> 
> - CyberMouse Serial ACR20S (PC/SC)
> - Gemplus MPCOS EMV
> - OpenCard.services = \
>     com.gemplus.opencard.service.gpk.factory.GPKCardServiceFactory \
>     opencard.opt.util.PassThruCardServiceFactory
> - OpenCard.terminals = \
>     com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminalFactory
> 
> I'm trying to execute the following method:
> 
>     private void readFile() {
>         System.out.println("begin readFile");
> 
>         try {
>             SmartCard.start();
>             System.out.println("SmartCard started.");
>             CardRequest cr = new CardRequest(CardRequest.NEWCARD, null,
>                     FileSystemCardService.class);
> 
>             System.out.println("Waiting for card...");
> 
>             SmartCard sc = SmartCard.waitForCard(cr);
>             System.out.println("Card inserted!");
>             System.out.println("Card ID = " + sc.getCardID());
> 
>             FileAccessCardService facs = (FileAccessCardService)
>                     sc.getCardService(FileAccessCardService.class,
>                          true);
>             System.out.println(facs.getRoot());
>             CardFile root = new CardFile(facs);
> 
>             sc.close();
>         } catch (Exception e) {
>             e.printStackTrace(System.err);
>         } finally {
>             try {
>                 SmartCard.shutdown();
>             } catch (Exception ignored) {
>             }
>         }
> 
>         System.out.println("end readFile");
>     }
> 
> And I'm getting the following output:
> 
> begin readFile
> SmartCard started.
> Waiting for card...
> Card inserted!
> Card ID = opencard.core.terminal.CardID@67e89 ATR: 3B 2A 00 80 65 A2 01 
> 01 01 3D 72 D6 43
> :3F00
> opencard.core.terminal.CardTerminalException: Pcsc10CardTerminal: PCSC 
> Exception in method SCardTransmit: error occurred with SCardTransmit
> return code = 00000057
> 
>     at 
> 
>com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal.translatePcscException(Pcsc10CardTerminal.java:502)
> 
> 
>     at 
> 
>com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal.internalSendAPDU(Pcsc10CardTerminal.java:439)
> 
> 
>     at opencard.core.terminal.CardTerminal.sendAPDU(CardTerminal.java:494)
>     at opencard.core.terminal.SlotChannel.sendAPDU(SlotChannel.java:115)
>     at 
> opencard.core.service.CardChannel.sendCommandAPDU(CardChannel.java:222)
>     at 
> 
>com.gemplus.opencard.service.gpk.access.GPKCardAccessor.internalSendCommandAPDU(GPKCardAccessor.java:581)
> 
> 
>     at 
> 
>com.gemplus.opencard.service.gpk.access.GPKCardAccessor.selectFile(GPKCardAccessor.java:474)
> 
> 
>     at 
> 
>com.gemplus.opencard.service.gpk.file.GPKFileAccessService.exists(GPKFileAccessService.java:164)
> 
> 
>     at 
> 
>com.gemplus.opencard.service.file.AbstractFileAccessCardService.getFileInfo(AbstractFileAccessCardService.java:169)
> 
> 
>     at opencard.opt.iso.fs.CardFile.<init>(CardFile.java:374)
>     at opencard.opt.iso.fs.CardFile.<init>(CardFile.java:231)
>     at smartcard.SmartCardTest.readFile(SmartCardTest.java:130)
>     at smartcard.SmartCardTest.main(SmartCardTest.java:176)
> end readFile
> 
> I can provide more information if needed. Just ask!
> 
> Thank you very much!
> 
> Sergio Saad
> 
> 
> ---
> 
>> 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.
> 

att-newpcsc.zip

Reply via email to