OpenJDK is looking for libpcsclite.so in wrong place on 64-bit 11.10

Bug #897299 reported by Steve Storey
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
openjdk-6 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

The OpenJDK codebase contains a class at sun.security.smartcardio.PlatformPCSC which looks at the sun.arch.data.model to see if it's a 64-but O/S or not. If so, and it's not SunOS then it adds a little piece into the library lookup path of lib64, thus meaning it looks for

/usr/lib64/libpcsclite.so

which doesn't exist in Ubuntu 11.10 as it's now at /usr/lib/libpcsclite.so instead.

There is a workaround of adding -Dsun.security.smartcardio.library=/usr/lib/libpcsclite.so as a JVM argument to force the library path, but this shouldn't be necessary.

To see the problem:

1. obtain a device that runs with pcscd
2. Compile the following Java code
3. Run with and without the -D flag above to see the difference (you shouldn't get the "None" provided by "None" message with the flag):

package com.moo.bug;

import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

import javax.smartcardio.CardException;
import javax.smartcardio.CardTerminal;
import javax.smartcardio.TerminalFactory;

public class BugDemo {

 private static final Logger log = Logger.getLogger(BugDemo.class.getName());

    public static void main(String[] args) throws Exception {
        long startTime = System.currentTimeMillis();
        // show the list of available terminals
        List<CardTerminal> terminals;
        try {
            TerminalFactory factory = TerminalFactory.getDefault();
            System.out.println("Factory is: " + factory);
            terminals = factory.terminals().list();
            System.out.println("Terminals: " + terminals);
        } catch (CardException e) {
            log.log(Level.SEVERE, "Could not open terminals: " + e.getMessage(), e);
            return;
        }
    }
}

Revision history for this message
exactt (giesbert) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in openjdk-6 (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.