Java Card APDU Error
<p>I am trying to send a simple APDU to a Java Card( I attached the simple code of the applet below).I already tested the applet in the Eclipse simulator but when I want to send an APDU to the applet it fails with the following error : <code>send_APDU() returns 0x80206E00 (6E00: Wrong CLA byte.)</code> .Applet is already installed into the card ( I used GpShell to do that ) .Here is the full output from the script I used to send the APDU.</p>

<pre><code>D:\GPShell-1.4.4&gt;GPShell.exe send_APDU.txt
establish_context
enable_trace
enable_timer
card_connect
command time: 15 ms
send_apdu -sc 0 -APDU b0000000010000
Command --&gt; B0000000010000
Wrapped command --&gt; B0000000010000
Response &lt;-- 6E00
send_APDU() returns 0x80206E00 (6E00: Wrong CLA byte.)
command time: 860 ms
card_disconnect
command time: 31 ms
release_context
command time: 0 ms
</code></pre>

<p>Here is the full code of the applet.</p>

<pre><code>public class Contor extends Applet {

private byte contor = 0;
private final static byte CLS=(byte)0xB0;
private final static byte INC=(byte)0x00;
private final static byte DEC=(byte)0x01;
private final static byte GET=(byte)0x02;
private final static byte INIT=(byte)0x03;

private Contor() {
}

public static void install(byte bArray[], short bOffset, byte bLength) throws ISOException {
    new Contor().register();
}

public void process(APDU apdu) throws ISOException {
    if(this.selectingApplet())return;
    byte[] buffer = apdu.getBuffer();
    if(buffer[ISO7816.OFFSET_CLA] != CLS)
        ISOException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED);
    switch(buffer[ISO7816.OFFSET_INS])
    {
        case INC:contor++;  break;
        case DEC:contor--;  break;
        case GET:
            buffer[0] = contor;
            apdu.setOutgoingAndSend((short)0,(short)1);
            break;
        case INIT:
            apdu.setIncomingAndReceive();
            contor = buffer[ISO7816.OFFSET_CDATA];
            break;
    }

}
</code></pre>