Our Online Store have the new products: RFID antenna board. Currently it can work with JC10M24R and JCOP4 card chips.
Compared with normal cards, the antenna board module has a smaller size and fixed holes, which is easy to integrate in the IOT(Internet Of Things) project.

javax.smartcardio error: Could not obtain response

JavaCard Applet Development Related Questions and Answers.
Diorin
Posts: 18
Joined: Thu Nov 26, 2015 4:08 am
Points :151
Contact:

javax.smartcardio error: Could not obtain response

Post by Diorin » Mon Oct 02, 2017 3:16 am

I came across an problem when using the Java Smart Card I/O API. No matter when I send a command APDU to my applet, and this command returns any data, and an exception is thrown:

Exception in thread "main" javax.smartcardio.CardException: Could not obtain response
at sun.security.smartcardio.ChannelImpl.doTransmit(ChannelImpl.java:169)
at sun.security.smartcardio.ChannelImpl.transmit(ChannelImpl.java:73)



Does anybody know how do I solve this problem?

User avatar
marjkbadboy
Posts: 33
Joined: Fri Jul 31, 2015 2:47 am
Points :217
Contact:

Re: javax.smartcardio error: Could not obtain response

Post by marjkbadboy » Mon Oct 02, 2017 6:29 am

I think that you are sending an APDU command case 1 (P3=0), just like:

Code: Select all

CLA INS P1 P2 Le


If your applet invoke the method

Code: Select all

setIncomingAndReceive()

, it will expect data from the APDU buffer, and if you don't send data, this exception will be throwed by smartcardio API.
It's hunting season!

User avatar
BrooksIQ
Posts: 18
Joined: Mon Jun 15, 2015 11:12 pm
Points :182
Contact:

Re: javax.smartcardio error: Could not obtain response

Post by BrooksIQ » Mon Oct 02, 2017 11:48 am

So as what has been mentioned above, even for APDU commands that are sent without any data attached. You have to send a dummy data attached to it.

At the applet side, do a setIncomingAndReceive()
first and ignore the retrieved dummy data. then proceed with your response.
Your mind will answer most questions if you learn to relax and wait for the answer---William S. Burroughs

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 15 guests

JavaCard OS : Disclaimer