Hello,
Naram El Adib wrote:
> I downloaded the package and i try with the java installOCF but got
> nothing. and i tried your solution, unzipped the two packages and
> copied the ../lib/*.jar files to the direction you mentined.
> but what is the next step, and how can i make sure that evrything
> work fine, I don't know .
I have attached a file named "INSTALL" that sort of details the
needed steps for installing and testing OCF (they are quite
straightforward, but it's always better to have them written..).
> I have downloaded the reflex60 pir java reader driver and i have it
> but how to link think or configure it the right way. I have no idea.
Just replace gemplus by reflex in the INSTALL file, you basically
just have to copy the jar into your java/jre/lib/ext/ repository
and configure an "opencard.properties" file. You'll have to know
the name of the reflex "Factory" class but you will certainly find
that in the doc or sources of the driver. (I just saw that Eric
Pearson has provided this info for the reflex driver).
Details on all this: installation, basic use, how to write components,
how to use in applications etc. can be found in the OCF 1.2
Programmer's Guide:
http://www.opencard.org/docs/pguide/PGuide.html
but I will try to put my small "howto" doc on our developer's web
site and let the list know when it's done. I have also a step by step
howto for the windows platform.
Hope it'll help.
Cheers,
Christophe.
= If I had more time, I would have written you a shorter letter. =
= -- Mark Twain. =
--
-------------------------------------------------------------
[EMAIL PROTECTED] - Gemplus Research Lab
Phone: +33 4-42-36-57-83 | Disclaimer: I don't speak for Gemplus
Gemplus doesn't speak for me... it is better that way!
-------------------------------------------------------------
========================================================================
========================================================================
STEPS IN INSTALLING OCF (e.g., under LINUX, SOLARIS, and WINDOWS)
========================================================================
========================================================================
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 (e.g., Linux,
Solaris, AIX, etc.). If you wish to have install instructions
dedicated to the Windows platform, please see INSTALL-WINDOWS.
1. download and install Java
1.1 in http://java.sun.com/j2se/1.3/, 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/j2re-1_3_0-beta_refresh-linux.tar.gz
1.2 install Java in /usr/local/ or anywhere else you might choose:
$ cd /usr/local/
$ gzip -dc /tmp/j2re-1_3_0-beta_refresh-linux.tar.gz | tar xvf -
$ mv -i jre1.3 java
$ PATH=/usr/local/java/bin:$PATH ; export PATH
2. download and install Comm API
2.1 in http://java.sun.com/products/javacomm/, select a Java
Communications API implementation for your platform. E.g.:
=> /tmp/javax_comm-2_0_1-solsparc.tar.Z
2.2 Only for Linux, you also need to download RXTX in addition
to the Javax_comm implementation for Solaris (for the JAR
file). In http://www.rxtx.org/, select and download RXTX:
=> /tmp/rxtx-1.4-5.tar.gz
3. download and install OCF:
3.1 in http://www.opencard.org/index-downloads.shtml, select to
download "OpenCard Framework Base" Zip'ed
=> /tmp/BaseOCF.zip
3.2 install OCF 1.2 core and optional parts
$ cd /usr/local/
$ unzip /tmp/BaseOCF.zip
3.3 in http://www.opencard.org/index-downloads.shtml, select to
download "The OpenCard Framework Reference Implementaion V1.2" Zip'ed
=> /tmp/Reference_Impl.zip
3.4 install OCF 1.2 reference components and demos
$ cd /usr/local/
$ unzip /tmp/Reference_Impl.zip
3.5 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/
4. download and install Gemplus Components:
4.1 in
http://www.gemplus.fr/developers/technologies/opencard/cardterminals/download.html
select to download "gemplus-terminals-4.1.tar.gz"
=> /tmp/gemplus-terminals-4.1.tar.gz
4.2 in
http://www.gemplus.fr/developers/technologies/opencard/cardservices/service/download.html
select to download "gemplus-service-0.2.tar.gz"
=> /tmp/gemplus-service-0.2.tar.gz
4.3 in
http://www.gemplus.fr/developers/technologies/opencard/cardservices/gpk/download.html
select to download "gemplus-gpk-0.2.tar.gz"
=> /tmp/gemplus-gpk-0.2.tar.gz
4.4 install the Gemplus components in the centralized OCF zone
$ cd /usr/local/OCF1.2
$ gzip -dc /tmp/gemplus-terminals-4.1.tar.gz | tar xvf -
$ gzip -dc /tmp/gemplus-service-0.2.tar.gz | tar xvf -
$ gzip -dc /tmp/gemplus-gpk-0.2.tar.gz | tar xvf -
4.5 install all Gemplus JAR files in Java
$ cd /usr/local/OCF1.2/lib
$ cp -i gemplus-terminals-4.1.jar gemplus-service-0.2.jar gemplus-gpk-0.2.jar
/usr/local/java/jre/lib/ext/
4.6 check OCF and Gemplus components (CardTerminal at least):
$ cd /usr/local/OCF1.2/components/sb-demo/src/demos/samples/
$ emacs opencard.properties
------
OpenCard.services = opencard.opt.util.PassThruCardServiceFactory
OpenCard.terminals =
com.gemplus.opencard.terminal.GemplusCardTerminalFactory|mygcr|GCR410|COM1
------
$ java demos.samples.GetCardID
and insert a card. You should get the card ATR displayed.
4.7 optionally, install a gempluscardterminal.properties file, which
can be used for tuning Gemplus CardTerminal parameters.
$ cd /usr/local/java/jre/lib/
$ emacs gempluscardterminal.properties
------
# If you want to let OCF poll the reader status then add:
# polling = usespollinglist
# Or If you want to define a thread to poll the reader at sleeptime then add:
polling = usesthread
#
# Time used to stop the thread for a period of time (in mili-seconds):
sleeptime = 500
------
========================================================================
========================================================================
INSTALLATION TROUBLESHOOTING FAQ
========================================================================
========================================================================
Test command: $ java -verbose -version
o java: command not found
=> Check that Java is installed and in your PATH (java/bin or java/jre/bin)
Second Test command: $ java demos.samples.GetCardID
o Can't find class xxx
=> Check that all JAR files for OCF base, opt, and demos have been installed
(in java/jre/lib/ext). Check also that needed components have been
installed, e.g., gemplus-terminal, gemplus-service, or gemplus-gpk.
o property file not found
------------------------------------------------------------
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, run:
$ java demos.tools.findOCP
o CardTerminalException: null
------------------------------------------------------------
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/OS and sometimes too alas 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 (on Linux) or jre/bin (on Windows).
Note: with properties file but w/o DLL, Java gives a different
type of error but still with the "null" message, e.g., 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 COM0 (COM1, 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., COM0, COM1, 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, Comm is not well installed!). Try to select
the one you want to use, Open, then Close the port.
o Can't open Communication port
------------------------------------------------------------
start use case: get a card ID
CardTerminalException:
Can't open Communication port
finished use case: get a card ID
------------------------------------------------------------
=> 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.
One good test is to run the javax.comm SerialDemo (see
paragraph above) to get all the listed ports in a menu
(auto-discovered by the Comm API driver).
o Invalid reader
------------------------------------------------------------
start use case: get a card ID
CardTerminalException:
Invalid reader!
finished use case: get a card ID
------------------------------------------------------------
=> You have 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 (GCR410, i.e., GemCore!).
There might be other troubleshooting entries added in the future:
this page is a work in progress! Do not hesitate to contribute
yourself!
Wed Sep 6 2000
[EMAIL PROTECTED]