Installation and Configuration

Overview

This chapter describes installation instructions and settings to configure the Zebra Scanner JPOS Driver on a host computer.

For custom installation instructions on installing the Zebra scanner JPOS driver, refer to the Installation and Configuration of Scanner SDK for Windows.

NOTE (for Windows): JPOS components are installed by default with the standard scanner SDK installation. If a custom scanner SDK installation is performed, the JPOS option must be selected to install the JPOS components.

NOTE (for Linux): JPOS components can be installed using RPM and Debian packages separately.


Configuration

Configuration for Windows

After a successful installation of the Zebra Scanner SDK with the JPOS driver, an XML file named JPOS.xml is created in the folder C:\Program Files\Zebra Technologies\Barcode Scanners\Scanner SDK\JPOS\Sample Applications\bin.

Setting JPOS CLASSPATH for Windows

The libraries required for the JPOS to run are referenced through classpath definitions. All the required classpaths are defined in the JPOSTest.bat file.

Why .bat file?

All the classpaths are defined through the JPOSTest.bat file to demonstrate which libraries are needed and how to load them to run the JPOS. Based on that the user can set the classpaths as needed from their custom locations. Zebra packages do not set .jar and libraries entries at system level classpath by default.

CLASSPATH Definitions


set PATH=%PATH%;%ProgramFiles%\Zebra Technologies\Barcode Scanners\Scanner SDK\JPOS\bin

Defines the directory which contains the CSJPOSScanner.dll and CSJPOSScale.dll files. These two .dll files acts as a link between the CoreScanner and the JPOS


set classpath=%classpath%;%ProgramFiles%\Zebra Technologies\Barcode Scanners\Scanner SDK\JPOS\External\xerces-2_11_0\xercesImpl.jar
set classpath=%classpath%;%ProgramFiles%\Zebra Technologies\Barcode Scanners\Scanner SDK\JPOS\External\xerces-2_11_0\xml-apis.jar

Defines the path to xercesImpl.jar and xml-apis.jar files. These are third-party libraries used for XML processing.


set classpath=%classpath%;%ProgramFiles%\Zebra Technologies\Barcode Scanners\Scanner SDK\JPOS\External\JavaPOS-1.14.0-Dist\javaPOS114.jar

Defines the path to the javaPOS114.jar file. This is the JPOS 1.14 service object.


set classpath=%classpath%;%ProgramFiles%\Zebra Technologies\Barcode Scanners\Scanner SDK\JPOS\bin\JposLogger.jar

Defines the path to the JposLogger.jar file. This handles the logging operations in JPOS.


set classpath=%classpath%;%ProgramFiles%\Zebra Technologies\Barcode Scanners\Scanner SDK\JPOS\bin\JposServiceJniScale.jar
set classpath=%classpath%;%ProgramFiles%\Zebra Technologies\Barcode Scanners\Scanner SDK\JPOS\bin\JposServiceJniScanner.jar

set classpath=%classpath%;%ProgramFiles%\Zebra Technologies\Barcode Scanners\Scanner SDK\JPOS\bin\JposServiceOnScale.jar
set classpath=%classpath%;%ProgramFiles%\Zebra Technologies\Barcode Scanners\Scanner SDK\JPOS\bin\JposServiceOnScanner.jar

set classpath=%classpath%;%ProgramFiles%\Zebra Technologies\Barcode Scanners\Scanner SDK\JPOS\bin\JposServiceScale.jar
set classpath=%classpath%;%ProgramFiles%\Zebra Technologies\Barcode Scanners\Scanner SDK\JPOS\bin\JposServiceScanner.jar

These six lines define the paths to the JPOS service object related .jar files. All these jar files are required for the execution of JPOS. They are categorized based on Scale and Scanner.


set classpath=%classpath%;%ProgramFiles%\Zebra Technologies\Barcode Scanners\Scanner SDK\JPOS\Sample Applications\bin\

Defines the directory which contains the JPOS sample app executable.

Visit Configure JavaPOS Scanner and Scale Drivers for Windows on a Custom Path KB article for more details.

Configuration for Linux

Following prerequisites are needed to run JPOS in Linux distributions.

  • libudev-dev
  • JDK (1.6 or above)
  • libgtk2.0-dev
  • ant

JPOS package can be installed by executing the following command inside the folder containing the .deb/.rpm packages.

For Debian distributions:


sudo dpkg -i zebra-scanner-javapos_X.X.X-X_amd64.deb

For RPM distributions:


rpm –ivh zebra-scanner-javapos-X.X.X-X.x86_64.rpm

Use the appropriate Package names when using the above commands. After the installation is completed, jpos.xml can be found in the location given below.


/usr/share/zebra-scanner/javapos/xml

The JPOS Sample Application can be found at:


/usr/share/zebra-scanner/samples/jpos-sample-app

Note that, this Application can only be run with JDK version 1.8 or above. In order to run the JPOS Sample Application in Linux, navigate to the location where the executable is located.


cd /usr/share/zebra-scanner/samples/jpos-sample-app

Execute the command mentioned below.


./jpos-sample-app.sh

Furthermore, a Sample Application especially catered to run with JDK 1.6 is provided to the users in the form of a zip file, 'jpos-sample-app-java1.6_vX.X.X-X.tar.gz' along with the package. In order to run the Application, extract and navigate to the below location.


cd jpos-sample-app-java1.6_vX.X.X-X/jpos-sample-app-java1.6

Please include the appropriate version in the above command. The Sample App can be run by executing the relevant '.sh' file.


./jpos-sample-app-java1.6.sh

Note that, this Sample Application has a limited set of features than what the above Sample App offers.

Setting JPOS CLASSPATH for Linux

References for the essential lib and JAR files needed for the proper execution of JPOS driver for Linux are defined as CLASSPATHs in the shell script jposampleapp.sh. These libs and JARS are loaded at runtime based on the CLASSPATH locations. In custom app development, it is possible to change the default CLASSPATHs into user appropriate locations to suit the custom requirement.

CLASSPATH Definitions

Shared object files of JPOS driver for Linux can be found in the path stated below.


LIB_PATH=$LIB_PATH:/usr/lib/zebra-scanner/javapos/jni
CLASSPATH=$CLASSPATH:$LIB_PATH

Third party JAR files responsible for XML processing are found in the path given below.


CLASSPATH=$CLASSPATH:/usr/lib/zebra-scanner/javapos/jpos/xercesImpl.jar	
CLASSPATH=$CLASSPATH:/usr/lib/zebra-scanner/javapos/jpos/xml-apis.jar

JAR file containing the path to the JPOS 1.14 service object is found in the path provided below.


CLASSPATH=$CLASSPATH:/usr/lib/zebra-scanner/javapos/jpos/javaPOS114.jar

The XML file containing the names of the logical devices and the corresponding settings is saved in the location below.


CLASSPATH=$CLASSPATH:/usr/share/zebra-scanner/javapos/xml

Logging configurations and JPOS trace properties can be done using the file available at the given location.


CLASSPATH=$CLASSPATH:/usr/share/zebra-scanner/javapos/config

Path for the JAR file managing the logging operations of JPOS is defined below.


CLASSPATH=$CLASSPATH:/usr/lib/zebra-scanner/javapos/jpos/JposLogger.jar

Paths that lead to JPOS service objects of both the scanner and the scale, that are essential for the JPOS driver execution are mentioned below.


CLASSPATH=$CLASSPATH:/usr/lib/zebra-scanner/javapos/jpos/JposServiceJniScale.jar
CLASSPATH=$CLASSPATH:/usr/lib/zebra-scanner/javapos/jpos/JposServiceJniScanner.jar

CLASSPATH=$CLASSPATH:/usr/lib/zebra-scanner/javapos/jpos/JposServiceOnScale.jar
CLASSPATH=$CLASSPATH:/usr/lib/zebra-scanner/javapos/jpos/JposServiceOnScanner.jar

CLASSPATH=$CLASSPATH:/usr/lib/zebra-scanner/javapos/jpos/JposServiceScanner.jar
CLASSPATH=$CLASSPATH:/usr/lib/zebra-scanner/javapos/jpos/JposServiceScale.jar

The path to the Jar file used by the JPOS sample application is defined below.


CLASSPATH=$CLASSPATH:/usr/share/zebra-scanner/samples/jpos-sample-app/JposSampleApp.jar


JPOS Logical Devices

The Zebra Scanner JPOS Driver reads jpos.xml to retrieve required configurations such as the baud rate for serial scanners and scanner filtering rules to form the logical scanner defined by the user. Each <JposEntry logicalName="LogicalScannerName"> tag defines a logical scanner. The following sample JPOSEntries represents serial, USB IBM Hand-held and USB SNAPI logical devices.

Wincor-Nixdorf Mode B


<JposEntry logicalName="ZebraScannerSerialNIXMODB">
    <creation factoryClass="com.zebra.jpos.service.scanner.SymScannerSvc112Factory" serviceClass="com.zebra.jpos.service.scanner.SymScannerSvc112"/>
    <vendor name="Zebra Technologies" url="https://www.zebra.com"/>
    <jpos category="Scanner" version="1.12"/>
    <product description="Zebra Serial" name="Zebra Serial NIXMODB Scanner" url="https://www.zebra.com"/>		
    <prop name="ScannerType" value="NIXMODB"/>
    <prop name="ExclusiveClaimLevel" value="0" />
</JposEntry>

SSI Serial Scanners


<JposEntry logicalName="ZebraScannerSerialSSI">
    <creation factoryClass="com.zebra.jpos.service.scanner.SymScannerSvc112Factory" serviceClass="com.zebra.jpos.service.scanner.SymScannerSvc112"/>
    <vendor name="Zebra Technologies" url="https://www.zebra.com"/>
    <jpos category="Scanner" version="1.12"/>
    <product description="Zebra Serial" name="Zebra Serial SSI Scanner" url="https://www.zebra.com"/>		
    <prop name="ScannerType" value="SSI_SERIAL"/>
    <prop name="ExclusiveClaimLevel" value="0" />
</JposEntry>

USB IBM Hand-held Scanners


<JposEntry logicalName="ZebraUSBHandHeld">
    <creation factoryClass="com.zebra.jpos.service.scanner.SymScannerSvc112Factory" serviceClass="com.zebra.jpos.service.scanner.SymScannerSvc112"/>
    <vendor name="Zebra Technologies" url="https://www.zebra.com"/>
    <jpos category="Scanner" version="1.12"/>
    <product description="Zebra USB Scanner" name="Zebra Scanner" url="https://www.zebra.com"/>
    <prop name="ScannerType" value="USBIBMHID"/>
    <prop name="ExclusiveClaimLevel" value="0" />
</JposEntry>

USB SNAPI Scanners


<JposEntry logicalName="ZebraScannerSNAPI">
    <creation factoryClass="com.zebra.jpos.service.scanner.SymScannerSvc112Factory" serviceClass="com.zebra.jpos.service.scanner.SymScannerSvc112"/>
    <vendor name="Zebra Technologies" url="https://www.zebra.com"/>
    <jpos category="Scanner" version="1.12"/>
    <product description="Zebra SNAPI Scanner" name="Zebra Scanner" url="https://www.zebra.com"/>
    <prop name="ScannerType" value="SNAPI"/>
    <prop name="ExclusiveClaimLevel" value="0" />
</JposEntry>

All Scanners


<JposEntry logicalName="ZebraAllScanners">
    <creation factoryClass="com.zebra.jpos.service.scanner.SymScannerSvc112Factory" serviceClass="com.zebra.jpos.service.scanner.SymScannerSvc112"/>
    <vendor name="Zebra Technologies" url="https://www.zebra.com"/>
    <jpos category="Scanner" version="1.12"/>
    <product description="Zebra Serial/USB Scanner" name="Zebra Scanner" url="https://www.zebra.com"/>
    <prop name="ScannerType" value="ALL"/>
    <prop name="ExclusiveClaimLevel" value="0" />
    <prop name="NcrScanNOFPattern" type="String" value="12"/>
    <prop name="NcrScanTonePattern" type="String" value="4"/>
    <prop name="DioScannerNotOnFile" type="String" value="12"/>
    <prop name="DioScannerDioNof" type="String" value="12"/>
</JposEntry>

Scale Devices


<JposEntry logicalName="ZebraScale">
    <creation factoryClass="com.zebra.jpos.service.SvcServiceInstanceFactoryImpl" serviceClass="com.zebra.jpos.service.scale.ScaleService113Impl"/>
    <vendor name="Zebra Technologies" url="https://www.zebra.com"/>
    <jpos	category="Scale" version="1.13"/>
    <product description="Zebra Scale" name="Zebra Scale" url="https://www.zebra.com"/>
    <prop name="ErrorOnSameWeight" value="1"/>
</JposEntry>

NOTE When a scale device (such as MP6200) is connected to a host PC via an RSM-supported host mode, scale functionality is available. The scale is accessible using the JPOS Open and Claim methods. RSM-supported host modes include SNAPI, IBM HH, IBM TT and SSI.


Scanner Configuration Bar Codes

Scan the Set All Defaults bar code below to return all parameters to the scanner's default values. Refer to the scanner's Product Reference Guide for default values.

Set All Defaults

Scan the appropriate bar code below to configure the scanner for either USB or RS-232 communication protocols.

USB Communication Protocol

Set All Defaults
Set All Defaults
Set All Defaults

RS-232 Communication Protocol

Set All Defaults

Logging

Logging for Windows

To configure logging for Scanner JPOS and Scale JPOS, use the jpos_trace.properties file located at C:\Program Files\Zebra Technologies\Barcode Scanners\Scanner SDK\JPOS\bin.

Following is a sample log section of this file.


###############################################################################
#################### JPOS Configurations Zebra Scanners #######################
# ZEBRA, ZEBRA TECHNOLOGIES, and the Zebra Logo are trademarks or registered  #
# trademarks of Zebra Technologies International, LLC, © 2022 Zebra           #
# Technologies International, LLC. All Rights Reserved.                       #
###############################################################################

###############################################################################
# logFileName:
# File name or lable for the log file
###############################################################################
logFileName=jpos.log

###############################################################################
# logFilePath:
# log file storing location default location is /var/log/corescanner/jpos
###############################################################################
logFilePath=C:\\Program Files\\Zebra Technologies\\Barcode Scanners\\Scanner SDK\\JPOS\\bin\\Logs

###############################################################################
# logFileSize:
# size of a single log file, this can be changed
###############################################################################
logFileSize=1048576

###############################################################################
# logFileCount:
# Maximum number of log files created by JPOS, new log file will be created once
# the current log file archive "logFileSize" in byte
###############################################################################
logFileCount=2

###############################################################################
# logLevel:
# Currently support only 2 values
# 0 - Disable logging
# 1 - Enable logging
###############################################################################
logLevel=1

Logging for Linux

The file jpos_trace.properties in Linux platform can be found in the location /usr/share/zebra-scanner/javapos/config

The following is the content present in the file jpos_trace.properties


###############################################################################
#################### JPOS Configurations Zebra Scanners #######################
# ZEBRA, ZEBRA TECHNOLOGIES, and the Zebra Logo are trademarks or registered  #
# trademarks of Zebra Technologies International, LLC, © 2022 Zebra           #
# Technologies International, LLC. All Rights Reserved.                       #
###############################################################################

###############################################################################
# logFileName:
# File name or lable for the log file
###############################################################################
logFileName=jpos.log

###############################################################################
# logFilePath:
# log file storing location default location is /var/log/zebra-scanner/jpos
###############################################################################
logFilePath=/var/log/zebra-scanner/jpos

###############################################################################
# logFileSize:
# size of a single log file, this can be changed
###############################################################################
logFileSize=1048576

###############################################################################
# logFileCount:
# Maximum number of log files created by JPOS, new log file will be created once
# the current log file archive "logFileSize" in byte
###############################################################################
logFileCount=2

###############################################################################
# logLevel:
# Currently support only 2 values
# 0 - Disable logging
# 1 - Enable logging with input output values for functions
# 2 - Enable logging with input output values for functions along with function names
###############################################################################
logLevel=1

###############################################################################
# ShowSensitiveInfo:
# Log sensitive information (Scan Data, Read Weight Values)
# 0 - Disable logging
# 1 - Enable logging
###############################################################################
showSensitiveInfo=1

###############################################################################
# enableCimPropertyFile:
# Log CIM properties related log file. Applicable for Linux only
# 0 - Disable creation of CIM property log file
# 1 - Enable creation of CIM property log file
###############################################################################
enableCimPropertyFile=1

JPOS Scanner and Scale related logs get created in the folder /var/log/zebra-scanner/jpos