JPOS Configuration Problems for an Epson POS printer in Windows

大城市里の小女人 提交于 2020-01-13 13:53:32

问题


I'm trying to print using jPOS in Windows and get the following exception:

jpos.JposException: Could not connect to service with logicalName = Printer: Exception.message=jp.co.epson.uposcommon.util.EpsonJposServiceInstanceFactory
    at jpos.loader.simple.SimpleServiceConnection.connect(Unknown Source)
    at jpos.BaseJposControl.open(Unknown Source)
...

More information:

I'm trying to port our Java printing software from Linux (where it works well) to Windows. We are using an Epson TM-T70 receipt printer. I installed the regular printer drivers and was immediately able to print stuff using notepad, for instance.

Now I installed the Epson JavaPoS ADK. I configured the printer using the SetupPOS application that comes with the ADK. I created a new configuration for my printer with Logical Device Name "Printer". I saved everything and it created the jpos.xml file.

When I try run our application and it executes printer.open("Printer") where "Printer" is the logical device name and printer is a POSPrinter instance, I get the exception above.

I know that my generated jpos.xml file is being used because if I provide a random logical device name, I get a different exception.

I guess the problem is in the port configuration of SetupPOS. The printer is connected through USB. I tried the Port name that appears in the windows printer properties (ESDPRT001) and I even tried all combiniations of COM1 to COM10 but nothing works.

Does anyone have some suggestion? Thanks!


回答1:


The Installation Routine of the Epson JavaPOS ADK is ... ahm ... let me say: "very special". So the Installation copies some jar files (like epsonupos.jar, jposXXX.jar and some more) in the ext/lib Directory of the JRE (!!!) (which must be selected while installing the JavaPOS Driver). We had also some very strange effects if we install another JavaPOS Version, switching to another JRE/JDK, using other Printers which are not from Epson or somthing else.

May be your problem is a result of any conflicts between different jar Version or JDK's or somthing else ...

EDIT:

Since ADK Version 1.11.anywhat (not realy sure, but I mean 1.11.9) you can specify the path in which the additional jar files are stored. But: Some DLL's will be also in the currently newest ADK Version (1.13.17) stored into the bin directory of the selected JRE. May be this is also a conflict between different Versions of used jar's and used DLLs or something else ...




回答2:


I Solved this adding the following library paths to java project:

C:\Program Files\EPSON\JavaPOS\lib

C:\Program Files\EPSON\JavaPOS\SetupPOS




回答3:


With javaPOS 1.14.6, on Debian 9 Linux I solved with LD_LIBRARY_PATH:

$ export LD_LIBRARY_PATH = /opt/EpsonJavaPOS/bin && javapos_application_to_run

On windows 10 copy:

BluetoothIO.DLL
epsonjpos.dll
EthernetIO31.DLL
SerialIO31.dll
USBIO31.DLL

from C:\Program Files\EPSON\JavaPOS\bin\

to C:\Program Files\Java\jre1.8.0.171\bin\

Run javaPOS application.




回答4:


I know is a little late for response but may help others with similar problems. In my case i am interacting with a Data logic Scanner using javapos, and i was having this message: ERROR: Failed to open DL-Magellan-9400i-USB-OEM-Scanner-Scale profile, jpos.JposException: Could not connect to service with logicalName = DL-Magellan-9400i-USB-OEM-Scanner-Scale: Exception.message=com.dls.jpos.service.DLSScannerInstanceFactory

i started looking in the javapos software that downloaded from datalogic and found that there was a jar file that was not included in my classpath (JavaPOS.jar) and that was why i was getting the error, take a look netx image:

I wanted to share in case someone has same issues. (Took me almost 2 days to get it done!!)



来源:https://stackoverflow.com/questions/3241087/jpos-configuration-problems-for-an-epson-pos-printer-in-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!