Need help with JavaPOS/UnifiedPOS
Hi, does anyone have any experience with JavaPOS?
The trouble is I can't find any tutorial on 'setting it up' and so I can't find out how to add it to my eclipse/netbeans project... and I can't compile the example code that was supplied with my thermal printer.
I have a Star TSP100ii receipt printer and a Cash Drawer that plugs into the back of the printer via RJ11 port. I've connected it up, installed the futurePRNT software and tested printing and kicking the cash drawer with the config utility... that all worked fine.
I checked the program folder, it has some JavaPOS samples which I'm supposed to be able to use in my project, however trying to compile that Java file gave some error... these were the instructions given in the sample file (to control the Cash Drawer):
Code:
// usage instructions - Windows
// 1. compile from command line - javac -classpath jpos113-controls.jar;jcl.jar StarCashDrawerTest.java
// 2. execute from command line - java -classpath .;starjavapos.jar;stario.jar;jpos113-controls.jar;jcl.jar;xercesimpl.jar;xml-apis.jar StarCashDrawerTest
Step 1 (compilation) was successful however step 2 gave this error:
Code:
jpos.JposException: Service does not exist in loaded JCL registry
at jpos.loader.simple.SimpleServiceManager.createConnection(Unknown Source)
at jpos.loader.JposServiceLoader.findService(Unknown Source)
at StarCashDrawerTest.runTest(StarCashDrawerTest.java:55)
at StarCashDrawerTest.main(StarCashDrawerTest.java:107)
StarCashDrawerTest finished.
This is the line 55:
Code:
// open the cashDrawer object according to the entry names defined in jpos.xml
cashDrawer.open("default");
There is a note about this code saying that "default" should be changed:
Code:
// NOTE: CHANGE THE CASH DRAWER NAME IN THE cashDrawer.open STATEMENT BELOW TO MATCH YOUR CONFIGURED DEVICE NAME
However, there is no information telling how to find out the 'configured device name'...
This is line 107:
Code:
new StarCashDrawerTest().runTest(args);
I have opened the JavaPOS docs (its now called UnifiedPOS) but its not very good... just a PDF file explaining each method available.
Does anyone know how to fix this? & how to add JavaPOS to my project in NetBeans/Eclipse?
thanks
Re: Need help with JavaPOS/UnifiedPOS
I didn't realise I was supposed to generate the "jpos.xml" file using the Config Utility that came from the printer vendor...
For Star you open "Configuration Utility", Select Star Line Mode, Click JavaPOS on the left side, press Create JPOS XML Registry File, Click Add New to add your printer and cash drawer - the name comes up automatically if it's connected --press OK, press Apply and the jpos.xml file will be automatically updated, throw that jpos.xml file into your project with the jar files. Also update the CashDrawer.open("default") to the names written in the jpos.xml file... it will say LogicalName="the_name".
Re: Need help with JavaPOS/UnifiedPOS
Thank you for sharing the solution. The problem isn't new ;)
db
Re: Need help with JavaPOS/UnifiedPOS
Hi
Just Check out the logical Name of the printer with cash drawer in jpos.xml or in config.xml(it is existed in TPGPOS printer factory classes).I don't have knowledge on how to operate the star receipt printer.I worked on TPG pos printer.Using config.xml file only you have to communicate with the printer as well as cash drawer.
your open cash drawer code is like this:
cashDrawer.open("logical name of the printer"); //which is defined in config.xml or jpos.xml
For this we need to interact with printer factory classes.
Thanks
phani.
Re: Need help with JavaPOS/UnifiedPOS
I created the JPOS XML registry file.
But it still have the same error when I try to execute the print hello world example that came into CD-ROM of the printer.
"jpos.JposException: Service does not exist in loaded JCL registry"
Where you threw the jpos.xml in yout project ? what jars file you put into your project ?
You buy the printer and it doesn't come with the instructions how setup your project. This is ridiculous.
With the Epson TM-T20 the application to make the registre is C:\Program Files (x86)\EPSON\JavaPOS\SetupPOS\SetupPOS.exe
It have create the jpos.xml file at same directory.
I have put the jpos111.jar and xercesImpl.jar in my project. But how the application knows how to load this jpos.xml file ?
Please, somebody help me.
Re: Need help with JavaPOS/UnifiedPOS
I tried almost every thing.
Load the jpos.xml with System.setProperty("jpos.config.populatorFile", path_to_jpos_xml); OK
but appeared some other problems, like: "don't find the ????.dll file", so I put the EPSON/JavaPOS/../lib to the java.library.path (ok)
but appeared another problem, I put all .jar file of EPSON on my class path. (ok)
but appeared another problem..... and so on.
It is really very difficult use JPos.
So i have found the Epson Virtual Port Drive application. Thats emulate a USB por with the COM port.
All my problem are solved. I used RXTXcoom.jar and rxtxSerial.dll to print and gave up this JPOS. :/
thanks..