JposException: Can't connect printer device (issue on linux only)

1.7k views Asked by At

I've developed a java application that works perfectly on windows when i print a receipt. The issue comes when the same java application is tested it in Ubuntu 14.04, and gives me this:

jpos.JposException: Can't connect printer device=SRP-350II
    at com.bixolon.jpos.services.printers.PrinterBaseService.claim(PrinterBaseService.java:256)
    at jpos.BaseJposControl.claim(BaseJposControl.java:296)
    at PruebaPOSImpresion.main(PruebaPOSImpresion.java:36)

It seems that the app finds the printer declared in jpos.xml since does the "open", but not the "claim". And it's strange that when i execute the "check health" on the printer (with the printer utility) it can print the test page with no problem.

Any help or suggestion is appreciated.

2

There are 2 answers

0
UserBL On BEST ANSWER

Give permissions to /dev/bus/usb/, so the jpos connection will recognize the connected printer

0
MKA On

Try to refer this solution Java POS printer error

Check your Jpos.xml path directory.. Windows vs Ubuntu File paths in Java (Linux)