The application returns an error:
jpos.JposException: Service does not exist in loaded JCL registry
I'm writing a Java application that should work with Zebra bar code scanners. The application itself is written on the Spring boot in conjunction with Java FX. For testing at start, I'm trying to get a list of connected devices: In the main method, I run the Java FX launcher. After that, in the start Java FX method, I run Spring. Then I'm trying to get a list of devices:
Scanner scannerObj = new Scanner(); String defaultLogicalName = "ZebraScannerUSB"; scannerObj.open(defaultLogicalName);
After this line, the exception is thrown. I understand that this is due to the fact that the program can not find jpos.xml. But I put it in src/main/resources, and in src/main/resources/jpos/res, and in the code I wrote the path to the external file:
System.setProperty(JposPropertiesConst.JPOS_POPULATOR_FILE_PROP_NAME, "C:"+File.separator + "Program Files" + File.separator + "Zebra Technologies" + File.separator + "Barcode Scanners" + File.separator + "Scanner SDK" + File.separator + "JPOS" + File.separator + "Sample Applications" + File.separator + "bin" + File.separator + "jpos.xml");
In the project, I also specified in the "project properties" in the build path the path to the native device drivers. What could be the problem? Maybe I missed something when configuring jpos?