OCF Installation - Answers
Frequently Asked Questions
Background and legal details
This HOWTO section details the list of commands you will
have to launch in order to install OCF on a Unix Workstation
(e.g., under Linux, Solaris, AIX, etc.).
Note that the steps below are generic guidelines on how to
install a running OCF platform for any type of computer, however, the
specified path and idiosyncrasies correspond more to Unix platforms.
If you wish to have install instructions dedicated to the Windows
platform (e.g., with windows-style PATHs, etc.), please see
the next section instead.
The steps are:
-
Download and install a Java Development Kit (or RunTime Environment)
-
In the Java Distribution Page, select Java for your platform
and OS (between Solaris, Linux, and Windows) and download either a
JRE (for using only) or a SDK (for developing too).
E.g., this gives: '/tmp/j2sdk-1_3_1-linux-i386.bin'
-
Then install Java in '/usr/local/' or anywhere else you
might choose:
$ mv -i /tmp/j2sdk-1_3_1-linux-i386.bin /usr/local/
$ cd /usr/local/
$ chmod a+x j2sdk-1_3_1-linux-i386.bin
$ ./j2sdk-1_3_1-linux-i386.bin
$ mv -i jdk1.3.1 java
$ PATH=/usr/local/java/bin:$PATH ; export PATH
|
-
Download and install the Comm API
-
In the Comm API HomePage, select a Java Communications API
implementation for your platform. E.g., this will give you:
'/tmp/javax_comm-2_0_2-solsparc.tar.Z' (Note that for
Linux, you will need to download the Comm API for Solaris (to get the
Java part of it) plus a native driver implementation,
mentioned below).
You must install the Comm API ('comm.jar') file into
your JDK 'jre/lib/ext/' directory and the Comm API
properties file ('javax.comm.properties') into your JDK
'jre/lib/' directory.
-
Only for Linux, you also need to download RXTX in addition
to the Javax_comm implementation for Solaris . In the
RXTX HomePage, select and download an RXTX distribution
and compile it. E.g., it will give: '/tmp/rxtx-1.4-8.tar.gz'.
After compiling RXTX on your platform, you must install Java
gnu.io packages (i.e., 'jcl.jar' file) into your
JDK 'jre/lib/ext/' directory and the native driver dynamic
library (i.e., 'libSerial.so'), into your JDK
'jre/lib/i386/' directory.
-
Download and install the OpenCard Framework
-
In the OCF Distribution Page, select to download "OpenCard Framework
Base" Zip'ed, e.g., '/tmp/BaseOCF.zip'
-
install OCF 1.2 core and optional parts:
$ cd /usr/local/
$ unzip /tmp/BaseOCF.zip
|
-
in the OCF Distribution Page, select to download "The OpenCard Framework
Reference Implementaion V1.2" Zip'ed, e.g., '/tmp/Reference_Impl.zip'
-
install OCF 1.2 reference components and demos:
$ cd /usr/local/
$ unzip /tmp/Reference_Impl.zip
|
-
finally, install all OCF 1.2 JAR files in Java:
$ cd /usr/local/OCF1.2/lib/
$ cp -i base-core.jar base-opt.jar sb-demo.jar
/usr/local/java/jre/lib/ext/
|
-
Download and install the Gemplus Components
Return to questions
This HOWTO section details the list of commands you will
have to launch in order to install OCF on a Windows Workstation
(e.g., under Win32 system: Win9x, NT or 2000).
We have chosen to give examples using an installation location that
is 'C:\ocf', of course you can specify whatever folder
name you wish.
The steps are:
-
Create 'C:\ocf' folder for gathering all necessary software.
-
Download and install a Java Development Kit (or RunTime Environment)
-
In the Java Distribution Page, select Java for the Windows platform
and download either a JRE (for using only) or a SDK
(for developing too). E.g., this gives:
'C:\Temp\j2re1_3_1-win.exe'
-
Then install Java in 'C:\ocf\java' or anywhere else you
might choose (note that there is no obligation for Java to be installed
under the OCF space, you can also choose 'C:\java' etc.).
double-click on j2re1_3_1-win.exe
select for install folder C:\ocf\java |
-
check by opening an MSDOS Command Prompt window and type:
to test that Java is found and can be run.
From now on, if you have installed a Java Runtime Environment
(JRE) please replace the 'C:\ocf\java' paths below by the
one you actually have, e.g., 'C:\ocf\java\jre1.3'.
On the other hand, if you have chosen to install a
Java Development Kit (JDK), then replace the
'C:\ocf\java' paths below by your 'jre' portion
of the JDK, e.g., 'C:\ocf\java\jdk1.3\jre'.
So for instance, in the JDK case, when we say
'C:\ocf\java\lib\ext', you should read
'C:\ocf\java\jdk1.3\jre\lib\ext'.
-
Download and install the Comm API
-
In the Comm API HomePage, select a Java Communications API
implementation for Windows. E.g., this will give you:
'C:\Temp\javaxcomm20-win32.zip'
-
install Comm API in 'C:\ocf\commapi'
-
double-click on 'C:\Temp\javaxcomm20-win32.zip'
-
extract all files in 'C:\ocf'
(this will create a 'C:\ocf\commapi' folder)
-
then, in an MSDOS Command Prompt window, type:
> cd C:\ocf\commapi\
> copy comm.jar C:\ocf\java\lib\ext\
> copy javax.comm.properties C:\ocf\java\lib\
> copy win32com.dll C:\ocf\java\bin\
|
-
check by opening an MSDOS Command Prompt window and type
> cd C:\ocf\commapi\samples\BlackBox\
> java -cp BlackBox.jar BlackBox
|
to test that Comm API is found and can find the ports.
Note: if PC/SC is running on your PC (especially in
Windows2000, where PC/SC is pre-installed and started by defaults),
then you will have to shutdown it; otherwise, as PC/SC
locks the ports, you will get a "port in use" execption.
To shutdown PC/SC, select Start / ControlPanel
/ GemplusSmartCardReader, and remove the line
corresponding to the port you want to use with OCF.
-
Download and install the OpenCard Framework
-
Download and install the Gemplus Components
See also the troubleshooting section below in case of problems.
Return to questions
This section gives a list of commands to try in order
to see whether each layer of the needed software infrastructure
is installed and working properly.
It then gives a list of classical errors you might get
and how to fix the related problem.
The following command allows to test that Java has been installed
and runs correctly.
Return to questions
If you have an error of the following type:
$ java -verbose -version
java: command not found
|
Check that Java is installed and in your PATH
(e.g., in Unix 'java/bin' or 'java/jre/bin')
Return to questions
The following command allows to test that OpenCard and the necessary
Java optional part (e.g., Comm API) have all been installed and run
correctly.
$ java demos.samples.GetCardID
|
Note that here there can be many types of errors when trying
to launch this OCF demo. Please see the (non-exhaustive) list
below for some possible problems and their solution.
Return to questions
If you have an error of the following type:
$ java demos.samples.GetCardID
Can't find class xxx
|
Check that all JAR files for OCF "base", "opt", and "demos" parts
have been installed (i.e., in 'java/jre/lib/ext'). Check
also that the needed components (for your application) have been
installed, e.g., "gemplus-terminal", "gemplus-service", and/or
"gemplus-gpk".
Return to questions
If you have an error of the following type:
------------------------------------------------------------
start use case: get a card ID
OpenCardPropertyLoadingException:
property file not found
finished use case: get a card ID
------------------------------------------------------------
|
Check that there is at least one property file that exist and is
readable for your current account. In order to find where OCF is
looking for 'opencard.properties', you can run the
following command:
$ java demos.tools.findOCP
|
If findOCP is not yet in your OCF distrib (it is not in the
default 1.2 distrib) see the appendix for how to compile and
install this useful program (a contrib from Jan Peter Hecking).
See also the "Configuring OCF" section of the
Programmer's Guide for a good reference on how to configure
the framework (i.e., what information to put in the properties
file(s) and where they must be located).
Return to questions
If you have an error of the following type:
------------------------------------------------------------
start use case: get a card ID
CardTerminalException:
null
finished use case: get a card ID
------------------------------------------------------------
|
There are two possible cause for this same message here: one
is a mis-installation of the Comm API's properties file, while
the other is a bad spelling for the actual serial port you
want to use, this name being most of the time dependant on the
platform, the OS, and sometimes also on the type of JDK...
-
Firstly, check that the Comm API layer has been installed,
i.e., 'comm.jar' in 'jre/lib/ext',
'javax.comm.properties' in 'jre/lib/',
and the '.so' or '.DLL' file (as specified
by 'javax.comm.properties') in a location that can be
found by the Operating System, e.g., in 'jre/lib/sparc'
or 'jre/lib/i386' (respectively on Solaris and Linux)
or in 'jre\bin' (on Windows).
Note: with a properties file but without the '.so' or
'.DLL' file , Java can give a different type of error
but which still includes the "null" message, e.g., here on Solaris:
Error loading SolarisSerial: java.lang.UnsatisfiedLinkError:
no SolarisSerialParallel in java.library.path
Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while
loading driver com.sun.comm.SolarisDriver
CardTerminalException:
null
|
-
Secondly, if everything is working well at the Comm layer,
check that you have not misspelled the name of the serial port
you intend to use. These names are different on different
platforms, e.g., on Linux, Solaris, or Windows, you can have
respectively '/dev/ttyS0' (S1, etc.),
'/dev/term/a' (/b, etc.), or 'COM1'
(COM2, etc.). Also be warned that the Comm API that comes with
JDK1.3 for Linux from IBM is using windows name
on Linux :-( (e.g., 'COM1', 'COM2', etc.)
so on Linux you should also check which kind of JDK you are using!
A very convenient way of: 1) finding the available ports and their
names and 2) test that you can open them, is actually to try to run
one of the demos of the Comm API:
$ cd commapi/samples/SerialDemo/
$ java SerialDemo
|
which will open a GUI with a menu containing all known ports (if
this menu is empty, then the Comm API has not well been installed!).
Try to select the one you want to use, Open, then Close the port.
Return to questions
If you have an error of the following type:
------------------------------------------------------------
start use case: get a card ID
CardTerminalException:
Can't open Communication port
finished use case: get a card ID
------------------------------------------------------------
|
Then again, check the name of serial port(s) that is (are)
specified in the properties file. For Windows it should be
'COM1', 'COM2', etc. For Linux
'/dev/sttyS0', '/dev/sttyS1', etc.
and for Solaris '/dev/term/a', '/dev/term/b',
etc.
On a Unix platform, check also that the user account you are
using has the right to use the ports, i.e., that the file access
permissions are as below:
$ ls -ls /dev/ttyS*
0 crw-rw-rw- 1 root tty 4, 64 May 31 09:09 /dev/ttyS0
0 crw-rw-rw- 1 root tty 4, 65 May 31 09:09 /dev/ttyS1
0 crw-rw-rw- 1 root tty 4, 66 May 5 1998 /dev/ttyS2
0 crw-rw-rw- 1 root tty 4, 67 May 5 1998 /dev/ttyS3
|
If not, become root and change the rights.
One good test is to run the Comm API SerialDemo (see
paragraph above) to get all the listed ports in a menu
which is auto-discovered by the Comm API driver.
Return to questions
If you have an error of the following type:
------------------------------------------------------------
start use case: get a card ID
CardTerminalException:
Invalid reader!
finished use case: get a card ID
------------------------------------------------------------
|
You get this message when the specification of the reader
type in the properties file does not match the actual reader
type. First check that the reader type is the one specified.
Then, if it is the case, try to reset the card reader (just
unplug it and plug it again) because sometimes, either the
Gemplus API or PC/SC can switch it to an OROS mode (for
legacy applications) that is not coherent with what is declared
in the properties file (e.g., GemPC410, for GemCore).
Return to questions
That's the end of the "Installation Troubleshooting" section.
There certainly will be other troubleshooting entries
added in the future: this page is a work in progress! Do not
hesitate to contribute yourself!
In order to install a new program, "findOCP", in your
OCF distribution, please follow the guidelines below. This program
is a contribution from Jan Peter Hecking that I slightly modified
to get platform-dependent file separtors (instead of "\" all the
time).
-
First, edit a file named 'findOCP.java' and include
the code below:
import java.io.File;
import java.util.Properties;
public class findOCP {
public static void main(String[] argv) {
final String sep = File.separator;
Properties props = System.getProperties();
String JavaHome = props.getProperty("java.home");
String UserHome = props.getProperty("user.home");
String UserDir = props.getProperty("user.dir");
System.out.println("Looking for OpenCard Properties file in:\n\t"
+ JavaHome + sep + "lib" + sep
+ "opencard.properties\n\t"
+ UserHome + sep + ".opencard.properties\n\t"
+ UserDir + sep + "opencard.properties\n\t"
+ UserDir + sep + ".opencard.properties\n");
}
}
|
-
Then compile it:
-
Finally install it in your Java Development Kit:
$ jar cvf findOCP.jar findOCP.class
$ cp -i findOCP.jar ..../java/jre/lib/ext
|
To run the program, simply type:
This program is useful to dicover which 'opencard.properties'
file is loaded and has priority. Note that when several files exist
in the listed locations, they are all loaded by the framework and
merged; the last entries overide the first ones, see the
"OpenCardPropertyFileLoader" section of the Programmer's
Guide for more details.
Return to questions
Last updated: June 07, 2001
HTML generated by FAQmaker, v0.3: 2000-07-27
|