Javax.smartcardio problem on linux SuSE

HI, i am trying to develop a simple applet in java, which should read data from a smartcard...
But when i want to read the terminals:
CardTerminal terminal = (CardTerminal)factory.terminals().get(0);
the full method:
CardTerminal terminal = (CardTerminal)factory.terminals().get(0);
try {
terminal.waitForCardPresent(15000);
if(terminal.isCardPresent())
System.out.println("Card Inserted!!");
else
System.out.println("TimeOut reached!!");
} catch (CardException e) {
// TODO Auto-generated catch block
e.printStackTrace();
an error occoures because factory.terminals() is empty.
Do you have any idea how to get the terminal list?
greets
Robson Previato

ps aux|grep pcscd
?

Similar Messages

  • Javax.smartcardio problems...

    HI, i am trying to develop a simple applet in java, which should read data from a smartcard...
    But when i want to read the terminals:
    CardTerminal terminal = (CardTerminal)factory.terminals().get(0);
    the full method:
    CardTerminal terminal = (CardTerminal)factory.terminals().get(0);
    try {
                   terminal.waitForCardPresent(15000);
         if(terminal.isCardPresent())
         System.out.println("Card Inserted!!");
         else
         System.out.println("TimeOut reached!!");
              } catch (CardException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
    an error occoures because factory.terminals() is empty.
    Do you have any idea how to get the terminal list?
    greets

    Hi!
    Are you running Windows or Linux? If you're using Windows, you shouldn't have any problem. But if it's Linux, you should download pcsc-lite and ccid. Try to google for these packages.
    See ya! ;)

  • Problem with APDUCommand in javax.smartcardio

    Hi,
    There seem to be a bug (from my point of view) with the javax.smartcardio when i attempt to send a command over to the card.
    There a code frag
    factory = TerminalFactory.getDefault();
            try {
                terminals = factory.terminals().list();
                System.out.println("Terminals: " + terminals);
                terminal = terminals.get(1);
                System.out.println("Card Present: " + terminal.isCardPresent());
                Card card = terminal.connect("*");
                channel = card.getBasicChannel();
                ResponseAPDU resp = channel.transmit(new CommandAPDU(selectcom));
                System.out.println("Select Resp: " + getHexString(resp.getBytes()));
                CommandAPDU com = new CommandAPDU((byte)0x43, (byte)0x52, (byte)0x00, (byte)0x00, 0);
                System.out.println("CommandAPDU: " + getHexString(com.getBytes()));
                resp = channel.transmit(com);
                System.out.println("Result: " + getHexString(resp.getBytes()));
                card.disconnect(false);
            } catch (CardException e) {
                e.printStackTrace();
            }There the result:
    Terminals: [PC/SC terminal OMNIKEY CardMan 5x21 0, PC/SC terminal OMNIKEY CardMan 5x21-CL 0]
    Card Present: true
    Select Resp: 90 00
    CommandAPDU: 43 52 00 00
    Result: 6E 00
    BUILD SUCCESSFUL (total time: 1 second)
    And there the result i tried with another tool (GPShell)
    select -AID 53504545454659503101
    --> 00A404000A53504545454659503101
    <-- 9000
    send_apdu -sc 0 -APDU 43520000
    Send APDU: 43 52 00 00
    --> 43520000
    <-- 9000
    Recv APDU: 90 00
    card_disconnect
    release_context
    Anyone have encounter the same problem?

    Refering to this code:
    factory = TerminalFactory.getDefault();
            try {
                terminals = factory.terminals().list();
                System.out.println("Terminals: " + terminals);
                terminal = terminals.get(1);
                System.out.println("Card Present: " + terminal.isCardPresent());
                Card card = terminal.connect("*");
                channel = card.getBasicChannel();
                ResponseAPDU resp = channel.transmit(new CommandAPDU(selectcom));
                System.out.println("Select Resp: " + getHexString(resp.getBytes()));
                CommandAPDU com = new CommandAPDU((byte)0x43, (byte)0x52, (byte)0x00, (byte)0x00, 0);
                System.out.println("CommandAPDU: " + getHexString(com.getBytes()));
                resp = channel.transmit(com);
                System.out.println("Result: " + getHexString(resp.getBytes()));
                card.disconnect(false);
            } catch (CardException e) {
                e.printStackTrace();
            }ResponseAPDU resp = channel.transmit(new CommandAPDU(selectcom));
    I already selected the applet here.
    With this command here
    static byte[] selectcom = new byte[] {(byte)0x00, (byte)0xA4, (byte)0x04, (byte)0x00, (byte)0x0A, (byte)0x53, (byte)0x50, (byte)0x45, (byte)0x45, (byte)0x45, (byte)0x46, (byte)0x59, (byte)0x50, (byte)0x31, (byte)0x01};
    So selecting the applet is done. And it return a 90 00. Then i start to send applet specific command.
    =)

  • Problems Installing Designer 6.0 over Oracle 8i (Linux SUSE 8.0)

    I have problems installing Designer 6.0 over Oracle 8i (Linux SUSE 8.0). When I try to create the repository the installation hang up. I try over Oracle 8i (WIndows 2000) and the problems remain.
    Please any body can help?
    Is it possible to install Designer 6i and generate forms 6.0 (I mean for using Developer 6.0 (NOT 6i))?
    Best regards,
    JAGC

    Marcel,
    I had the same problem. Oracle gives as an answer that Designer 6.0 is not supported against 8.1.7. In the specified package a statement is issued which is a problem for 8.1.7. I changed that package and now it works fine.
    Comment as below and replace with the delete statement, then it compiles fines.
    I don't know if any problem can occur after that, but a Migration from a 1.3.2 repository to 6i works fine through this repository. Hope this helps.
    Kind Regards
    Jan Boersma
    Email: [email protected]
    see here:
    -- Remove Reserved Names entry and comment
    -- delete from sdd_reserved_names
    -- where (rn_res_name, rn_type) in ((upper(view_name), 'VIEW')
    -- ,(upper(pack_name), 'PACKAGE')
    -- ,(upper(pack_name), 'PACKAGE BODY')
    -- ,(upper(app_view_name), 'VIEW BODY'));
    delete from sdd_reserved_names
    where ((rn_res_name = UPPER(view_name) AND rn_type = 'VIEW') OR
    (rn_res_name = UPPER(pack_name) AND rn_type = 'PACKAGE') OR
    (rn_res_name = UPPER(pack_name) AND rn_type = 'PACKAGE BODY') OR
    (rn_res_name = UPPER(app_view_name) AND rn_type = 'VIEW BODY'));
    null

  • Help me - I have a problem of using the javax.smartcardio

    Hi everybody!!!
    I'm creating an application to communicate with javacard.
    I searched on internet and know about javax.smartcardio.
    But I can not use it, even it's inside the default library of Java 6.
    I already import the javax.smartcardio.*; to my java file.
    But it can not find the class inside this package.
    Can somebody help me? Thanks a lot.

    Hi everybody.
    I got the advice from Mr. Safarmer on this forum.
    So:
    If you're using Eclipse to develop the application.
    You have to set the JRE Library to Alternate JRE.
    Below is the instruction for dummies like me ^^:
    Go to Build Path > Configure Buil Path of your project
    In Libraries tab, Edit the JRE System Library
    Instead of choosing the Execution Environment, we choose Alternate JRE (usually jre6)--> This is my case. And i did it.

  • File problem in linux OS.

    hi,
    I am creating one jar file . In my program, when I click one survey menu in my GUI,it will collect information from remote device and store it in log file located LOG folder. In my case, I put one folder " Cal" and inside it I put myjar.jar file and that log (LOG) folder.
    In Windows, when I click survey menu in GUI, the log information automatically stored in log foder as survey.txt file. And also, i create one show dialog box to show where the log file located.
    my code is,
    String  ss=new String(" HIllo"+"loginfo" );           
                     byte b[]=ss.getBytes ();
                           OutputStream f0=new FileOutputStream               ("LOG/survey.log",true);
                           f0.write(b);
                           f0.flush();                      
                           f0.close ();    the above code is file writing in txt file.
    for display dialog box,
    if(source==Survey)
                    File file = new File("LOG/Survey.log");                      
                    file = file.getAbsoluteFile(); 
                    javax.swing.JOptionPane.showMessageDialog(MainFrame, "The LOG FILE is stored at -- \t \t"+file);
                 }In windows, where can i install that Cal folder (inside it JAR file and LOG folder), and click that jar , all are working fine. The log file stored correctly inLOG folder and dialog box show the located path.
    eg. log file stored at D:/sbk/Cal/LOG/survey.log
    But my problem in linux.
    when i click survey menu, it will defaultly stored in root folder and log folder. Actually i am not creating LOG folder in root folder.
    I am changing file writer as , to store that JAR folder and want to store that log file in home directory.
    if(no_of_ssid!=null){
                    String  ss=new String(""HIllo"+"loginfo\n" );          May
                     byte b[]=ss.getBytes ();
                           OutputStream f0=new FileOutputStream ("/home/Cal/LOG/Survey.log",true);
                           f0.write(b);
                           f0.flush();                      
                           f0.close ();    but, now also that file stored in rot directory.
    what can I do.
    how can I store log file in home/Cal/Log folder in Linux.
    any one help this problem

    Use System get prop user.home?

  • Javax Comm API on linux

    Hi,
    I am using javax comm API on linux. I am using RXTX comm API release 1.4 that uses gnu.io.RXTXCommDriver on J2ME Personal Profile Runtime Environment for x86 Linux Version 1.0.
    When I try to open a serial port, I get javax.comm.NoSuchPortException. What could be the problem? Does the cvm not support comm API. Is there any alternate way?

    I am looking for one too.. i figured better would be to use JNI classes... but i havent yet implemented it.. mebbe that will cause even more problemos..
    please post here if you find smthing

  • Java 2SE and Linux SuSE 8.1 Prof.

    Hi,
    What do you think about relationship as in the topic, Java 2SE on Linux SuSE 8.1, does it work?
    Regards
    Krzysztof

    I do all my development work (JFreeChart, JFreeReport) using Eclipse on SuSE 8.1 Professional (Gnome desktop). I don't have any problems with it...
    Regards,
    Dave Gilbert
    http://www.object-refinery.com

  • Linux Suse 64bits & BOXI3.1 Physical Memory

    Hi,
    These are the question.
    We have a server Linux Suse (64 bits) with 48 GB RAM and Business Objects XI 3.1 SP3 (32 Bits) the problem is that it only takes 4GB of memory instead of 48 GB
    The CMC Metrics show only 4gb.
    somebody has an idea why only takes 4gb ?
    Thank you

    Hi;
    this is not a problem, this is the way BOE XI 3 is build and delivered, so no workaround, BOBJ XI 3 is compiled as 32bits, so no way to go above this 4GB limit (even 2 on Windows), your only and recommended option is to have several instances of the servers that are actively used.
    The only process that can be switched to 64 bits, it the JVM running Tomcat, this article explains how to do it on Windows ( http://wiki.sdn.sap.com/wiki/display/BOBJ/Quickandeasytomcat64bitsconfigurationwithBOEXI3.1onWindows64+Bits ), read it and adapt for Linux.
    For your information, starting with XI 4.0, all server binaries will be delivered as 64 bits only.
    Regards;
    Lionel

  • AIR problems on Linux

    I am using Flex on linux suse 64 bit without problems, however I have problems with AIR. I can run an air application generated
    in windows for instance, I can compile an air application using amxmlc, but when I try to run it using adl I get the following error:
    /usr/bin/javaclassname: Class file corrupt
    /usr/bin/javawrapper:
       should be in a file called .class
    Also when I try to build AIR application using an IDE like IntellJIDEA or Netbeans, I have similar errors.
    Anyone has any clues about it ?
    Thank You,
    Walter

    I am using Flex on linux suse 64 bit without problems, however I have problems with AIR. I can run an air application generated
    in windows for instance, I can compile an air application using amxmlc, but when I try to run it using adl I get the following error:
    /usr/bin/javaclassname: Class file corrupt
    /usr/bin/javawrapper:
       should be in a file called .class
    Also when I try to build AIR application using an IDE like IntellJIDEA or Netbeans, I have similar errors.
    Anyone has any clues about it ?
    Thank You,
    Walter

  • Java 6: javax.smartcardio - can't get CPLC

    Hello! I have a problem - can't get CPLC with classes from javax.smartcardio (get SW=6a88), but I easily get it with com.sun.javacard.apduio classes from Java Card Kit 2.2.2.
    Here the test code for javax.smartcardio :
    import java.util.List;
    import javax.smartcardio.*;
    public class TestSmartCardJSE60
    public static void main(String[] args)
      try
       TerminalFactory tf = TerminalFactory.getInstance("PC/SC", null);
       CardTerminals cts = tf.terminals();
       List<CardTerminal> avaiableTerminals = cts.list();
       CardTerminal ct = avaiableTerminals.get(0);
       Card card = ct.connect("*");
       try
        CardChannel channel = card.getBasicChannel();
        CommandAPDU capdu = new CommandAPDU(0x80, 0xCA, 0x9F, 0x7F);
        ResponseAPDU res = channel.transmit(capdu);
        System.out.printf("%s%n", res);
       finally
        card.disconnect(true);
      catch(Exception e)
       e.printStackTrace();
    }And here the same for com.sun.javacard.apduio
    import com.sun.javacard.apduio.*;
    public class TestSmartCardJCK222
    public static void main(String[] args)
      try
       CadClientInterface cad = CadDevice.getPCSCClientInstance(0);
       cad.powerUp();
       try
        Apdu capdu = new Apdu();
        capdu.command[Apdu.CLA] = (byte) 0x80;
        capdu.command[Apdu.INS] = (byte) 0xCA;
        capdu.command[Apdu.P1] = (byte) 0x9F;
        capdu.command[Apdu.P2] = 0x7F;
        cad.exchangeApdu(capdu);
        System.out.printf("%s%n", capdu);
        capdu.setLe(0x2D);
        cad.exchangeApdu(capdu);
        System.out.printf("%s%n", capdu);
       finally
        cad.powerDown(true);
      catch(Exception e)
       e.printStackTrace();
    }I run both tests under WindowsXP SP3 with ORGA ECO5000 Usb and JCOP21 smart card.
    What is my problem? Actualy I want to use javax.smartcardio for my application, because classes from that package more useful than com.sun.javacard.apduio;
    Any ideas?

    You're missing the Le byte, since you're expecting data back. Try it.

  • How to get a handle which is used in c dll from  javax.smartcardio.card

    good afternoon
    i am using javax.smartcardio.card to operate a sim-card reader .
    but i have a dll which is call sim-card reader by handle.
    how can i get a handle from a javax.smartcardio.card object to pass to the dll
    next is the code .
    c dll prototype declaration
    char DoFormat([in] unsigned long P1�C[in] char * P2�C[in] bool P3,[in][out] char *P4)P1 is a handle
    java code:
    private boolean checkCardReader(boolean isopen)
    boolean r=false;
    try {
    javax.smartcardio.card card;
    TerminalFactory factory = TerminalFactory.getDefault();
    List terminalList = factory.terminals().list();
    terminal = (CardTerminal) terminalList.get(0);
    // establish a connection with the card
    card = terminal.connect("T=0");
    channel = card.getBasicChannel();
    //how can i get a handle which can be used by windows dll .
    }catch (Exception ex)
    System.out.println("Exception : " + ex);
    return r;
    *****************************************************************

    Presumably you are calling a C library method that returns a handle.
    Normally a handle will be a integer type value.
    With such a value you can cast it into a java integer type and then cast it back in different JNI code by passing it to those routines.
    A java long is as big as you can get and will hold most every normal type handle item. You should however verify sizes.

  • Error while installing developer 10g on linux suse 10.0

    Hi All,
    This error appears while installing developer 10g on linux suse 10.0
    http://img179.imageshack.us/my.php?image=errorso9.png

    Try locate (using find command for example) the libjvm.so file (I assume that is located somewhere under $ORACLE_HOME (probably jdk or jre directory)). If you locate the path where this library resides, try to add that path to $LD_LIBRARY_PATH enviroment variable.
    Use copy&paste method (for error message) rather than link to image.
    It is much quicker operation and it may help to other people because they be able to find this thread via search engine.

  • Help need in javax.smartcardio.exception

    getting error
    javax.smartcardio.CardException: sun.security.smartcardio.PCSCException: Unknown error 0xc000002b
    at sun.security.smartcardio.ChannelImpl.doTransmit(ChannelImpl.java:202)
    at sun.security.smartcardio.ChannelImpl.transmit(ChannelImpl.java:73)
    while setting pin limit in the card.
    Please help what is the cause of getting this error.
    thanks in advance

    First you should check that the library has the checkbox 'Deploy by default' is checked for your library.
    The you open the project properties of the view controller project, select Deployments, edit the deployment descriptor. Select the Node 'File Groups'->'WEB-INF/lib'->'Contributors'. this should give you a list of libraries your project uses. Check if your library has the checkbox checked (is selected fro deployment). If it's not checked, set it.
    This should include the library.
    Timo

  • Path problem in linux

    hi,
    i have problem with file path accessing in linux. my java class is accessing a abc.cvs file and and getting all data. it is working fine in windows xp. but i run this same file in linux it does not access the abc.cvs file and does not get any data.
    my project structure
    Search
    abc.cvs
    search.SearchMain
    i am sccessing this cvs file in this SearchMain class by this way file name = "abc.cvs"
    It is working fine with window but problem with linux.
    when i place this abc.cvs in a folder as "./data/abc.cvs" also working fine with windows but not in linux.
    I am new for linux.
    Please give me solution.
    Thanks in advance
    Ravi

    There shouldn't be any differences between Linux and Windows here, it's all about your environment. In order to access abc.cvs class (I presume that abc is package name) from search.SearchMain class you need to have a directory (or .jar file) containing abc/cvs.class in your CLASSPATH environment variable.
    Try setting it with
    export CLASSPATH=your_dir_or_jar_file:$CLASSPATH
    and then running the app again.

Maybe you are looking for

  • Windows 8.1 Camera

    I am writing a program that opens up a camera feed to display within an OpenGL window. Using DirectShow this works no problem. However, I need to access the Built-In Front&Rear camera on a Microsoft Surface Tablet with this program. I can access thes

  • Labview 7.1 and Dual Core Processors

    Hi, I was wondering if anyone has encountered any problems using Labview 7.1 and the newer dual-core processors. I have a Dell Dimension DXPO51, 2.8 GHz Pentium D with 1 GB ram. There is NO virus software or any other non-essential programs running i

  • Purchase org

    Dear All, I have assigned one purchase organization to one company code. but when i create one vendor that time i given purchase organization to other which are not assigned to company code. system will accept & vendor has created but idont want this

  • Highlight Words After Querying

    I have a report in which I query several columns. I want to be able to highlight the word I'm querying wherever the word is found (same functionality you have in this forum when clicking on "search"). I think the answer might be in: Home>Application

  • Saving docs in MS Office

    Hi I'm using MS office on my MacBook Pro and when I go to save a doc or spreadsheet, I only get a limited list of places to save to. I don't get a dropdown to choose folders and sub-folders. I've been saving to desktop and then moving to the appropri